小编Nab*_*eel的帖子

ASP.NET Core Identity,如何覆盖 IdentityRole Name 唯一索引?我想存储与租户相关的重复名称

我正在编写 IdentityRoleManager 的扩展以允许多租户角色。角色在不同租户中可以具有相同的名称,他们可以将自己的声明分配给角色。

如何允许表中的角色名称重复?我打算通过 RoleManager 实现的每个租户的角色名称都是唯一的。

尝试了 OnModelCreating FluentApi 但它没有像 EF6 那样提供对象作为注释传递

builder.Entity().ToTable("PenRoles") .Property(p => p.Name).HasAnnotation("Index", new _____{ });

怎么做?

c# asp.net-identity asp.net-core

3
推荐指数
1
解决办法
1600
查看次数

标签 统计

asp.net-core ×1

asp.net-identity ×1

c# ×1