Skip to content

Understanding Identity integration #71

@HybridSolutions

Description

@HybridSolutions

Hi, first of all, great project!

When I found it I was interested on how you integrated .NET Core identity into it but I got confused. Hope you can clarify my doubts. I can see you have in the migration files

modelBuilder.Entity("FSH.WebApi.Infrastructure.Identity.ApplicationRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("nvarchar(450)");

                    ...

                    b.Property<string>("TenantId")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("nvarchar(64)");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName", "TenantId")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex")
                        .HasFilter("[NormalizedName] IS NOT NULL");

                   ...

but you haven't added any additional properties to ApplicationRole or any other classes

public ApplicationRole(string roleName, string? description = null)
        : base(roleName)
    {
        Description = description;
        NormalizedName = roleName.ToUpperInvariant();
    }

So my question is, did you generate the migration files manually? How is TenantId appearing in the ApplicationRole entity? If yes, why didn't you customize Identity classes to receive these new properties?

My other question is, do all Identity User and Role methods work taking into account the TenantId? I'm asking this because I didn't find any UserStore or RoleStore customizations to deal with this property with CRUD operations.

Thank you and please keep up with this project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions