在 AbpRoleBase class 上覆盖 属性

Override property on AbpRoleBase class

我正在尝试使用其他属性扩展 RolePermissionSetting class 问题是这个 class 是在抽象 中声明的跨框架使用的 AbpRoleBase class 是否有一种方法可以在不在数据库中生成不同的 AbpPermissions table 的情况下完成此操作。

这是一段代码:

public abstract class AbpRoleBase : FullAuditedEntity<int>, IMayHaveTenant{

..
public virtual ICollection<RolePermissionSetting> Permissions { get; set; }
}

my Role class inherit from AbpRole(ZeroModule) which override AbpRoleBase, I'm afraid that if I replace that class with my own, EF will generate a new table in the model then I'll have two Role Tables.

EF 不会生成新的 table,但会添加一个 Discriminator 列,这应该没问题。

AbpRole 实施,而不是覆盖 AbpRoleBase。您可以在 Role.cs.

中安全地覆盖 Permissions 属性