Rayab.Identity 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rayab.Identity --version 1.1.1                
NuGet\Install-Package Rayab.Identity -Version 1.1.1                
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.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rayab.Identity --version 1.1.1                
#r "nuget: Rayab.Identity, 1.1.1"                
#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.1.1

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

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,291 2/12/2021
1.2.5 331 2/12/2021
1.2.4 1,266 12/23/2020
1.2.3 523 12/23/2020
1.2.2 501 12/8/2020
1.2.1 539 12/7/2020
1.2.0 526 12/7/2020
1.1.9 478 12/7/2020
1.1.8 493 12/7/2020
1.1.7 1,043 12/2/2020
1.1.6 528 12/2/2020
1.1.5 663 11/30/2020
1.1.4 389 11/30/2020
1.1.3 574 11/30/2020
1.1.2 430 11/30/2020
1.1.1 445 11/30/2020
1.1.0 509 11/30/2020
1.0.9 521 11/25/2020
1.0.8 532 11/25/2020
1.0.7 387 11/25/2020
1.0.6 412 11/25/2020
1.0.5 546 11/25/2020
1.0.4 395 11/25/2020
1.0.3 401 11/24/2020
1.0.2 924 11/23/2020
1.0.1 476 10/10/2020
1.0.0 435 10/5/2020

Email field and navigation properties optimized.