Search code examples
aspnetboilerplate

Override property on AbpRoleBase class


I'm trying to extend the RolePermissionSetting class with additional properties the thing is that this class is declared in abstract AbpRoleBase class, which is used across the framework is there a way to accomplish this without generating a different AbpPermissions table in the DB.

Here is the piece of code:

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

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

Solution

  • 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 will not generate a new table, but add a Discriminator column, which should be fine.

    AbpRole implements, not overrides, AbpRoleBase. You can safely override Permissions property in Role.cs.