Rayab.Identity 1.2.6

dotnet add package Rayab.Identity --version 1.2.6
NuGet\Install-Package Rayab.Identity -Version 1.2.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rayab.Identity" Version="1.2.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rayab.Identity --version 1.2.6
#r "nuget: Rayab.Identity, 1.2.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Rayab.Identity as a Cake Addin
#addin nuget:?package=Rayab.Identity&version=1.2.6

// Install Rayab.Identity as a Cake Tool
#tool nuget:?package=Rayab.Identity&version=1.2.6

Rayab Identity Document

Installation:

To install a Rayab.Identity use

Search in Package Manager

Rayab.Identity

Package Manager Console

Install-Package Rayab.Identity -Version 1.0.2

.NET CLI

dotnet add package Rayab.Identity --version 1.0.2

PackageReference

<PackageReference Include="Rayab.Identity" Version="1.0.2" />

Paket CLI

paket add Rayab.Identity --version 1.0.2

Why do we need this library?

If you want to share your project with other developers, and you do not like to share your base project, They need these Tables. So, Whit this library you can share your Identity tables together without main project codes.

How To Use:

For example, create an ApplicationDbContext like this:

using System.ComponentModel.DataAnnotations;
using System.Linq;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using RIdentity;
using RIdentity.AccessPermissions;
using RIdentity.Department;
using RIdentity.Website;

namespace Sample
{
    public class ApplicationDbContext : IdentityDbContext<Users, Role, string, UserClaim, UserRole, UserLogin, RoleClaim, UserToken>
    {

        public RDbContext(DbContextOptions options)
            : base(options)
        {
        }
    }
}

You can install tables like this:

public DbSet<UserSocialNetworks> UserSocialNetworks { get; set; }
public DbSet<Departments> Departments { get; set; }
public DbSet<DepartmentToPermissionGroups> DepartmentToPermissionGroups { get; set; }
public DbSet<DepartmentPermissionGroupToPermissions> DepartmentPermissionGroupToPermissions { get; set; }
public DbSet<WebsiteInformation> WebsiteInformation { get; set; }
public DbSet<WebsiteSocialNetworks> WebsiteSocialNetworks { get; set; }
public DbSet<PermissionGroups> PermissionGroups { get; set; }
public DbSet<Permissions> Permissions { get; set; }

Or you can customize more like this:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    base.OnModelCreating(modelBuilder);
    modelBuilder.Entity<Users>(b =>
        {
            // Each User can have many UserClaims
            b.HasMany(e => e.Claims)
                .WithOne(e => e.Users)
                .HasForeignKey(uc => uc.UserId)
                .IsRequired();
    
            // Each User can have many UserLogins
            b.HasMany(e => e.Logins)
                .WithOne(e => e.Users)
                .HasForeignKey(ul => ul.UserId)
                .IsRequired();
    
            // Each User can have many UserTokens
            b.HasMany(e => e.Tokens)
                .WithOne(e => e.Users)
                .HasForeignKey(ut => ut.UserId)
                .IsRequired();
    
            // Each User can have many entries in the UserRole join table
            b.HasMany(e => e.UserRoles)
                .WithOne(e => e.Users)
                .HasForeignKey(ur => ur.UserId)
                .IsRequired();
    
            b.ToTable("Users").Property(p => p.Id).HasColumnName("UserID");
        });
    //And...
}

All you have to do is use Users name instead of IdentityUser, or other names. This is an image of SQL database tables.

Database Tables

We have created another library to further customize this "Rayab.Identity".

You can download that in this Article in NuGet.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Rayab.Identity:

Package Downloads
Rayab.ApplicationDbContext

You can use ASP.NET Core ApplicationDbContext like a portable library. It's funny and it's very easy to use. In this "ApplicationDbContext" the name of the Identity tables is modified, for example, you have the name of the "Users" table instead of "AspNetCoreIdentityUser". In this library, we have eliminated all relationships and table names, and you just need to extend your class to our library. To create this ApplicationDbContext we used Rayab.Identity tables. that library imported to project from GitHub. Read the document for more information.

Rayab.Default

Personal Library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.6 1,145 2/12/2021
1.2.5 308 2/12/2021
1.2.4 1,189 12/23/2020
1.2.3 486 12/23/2020
1.2.2 458 12/8/2020
1.2.1 511 12/7/2020
1.2.0 486 12/7/2020
1.1.9 451 12/7/2020
1.1.8 465 12/7/2020
1.1.7 946 12/2/2020
1.1.6 505 12/2/2020
1.1.5 612 11/30/2020
1.1.4 355 11/30/2020
1.1.3 525 11/30/2020
1.1.2 416 11/30/2020
1.1.1 415 11/30/2020
1.1.0 486 11/30/2020
1.0.9 488 11/25/2020
1.0.8 495 11/25/2020
1.0.7 376 11/25/2020
1.0.6 383 11/25/2020
1.0.5 511 11/25/2020
1.0.4 378 11/25/2020
1.0.3 373 11/24/2020
1.0.2 849 11/23/2020
1.0.1 445 10/10/2020
1.0.0 411 10/5/2020

- Add RoleToPermission