Skip to content

Provide a way to add mapping for ApplicationUser #22

Open
@ghost

Description

My scenario was this:
I have an ApplicationUser class which derives from IdentityUser. I would like to use a table-per-hierarchy inheritance model (all classes in the same table) in order not to generate unnecessary tables in the db.

However, it's not possible to achieve by using the MappingHelper class. Although, I can provide an additional type to map, I have no control over the mapping. For example, I needed to generate the discriminator column in the IdentityUserMap and then provide discriminator value in the ApplicationUserMap.

Moreover, the schema that gets generated for the ApplicationUser table is not very good - no foreign keys or indexes. I suppose this is because I can't supply ClassMapping to the ConventionModelBuilder so it uses some basic conventions only to map property to columns.

Would you consider providing a way to pass not only additional types to map, but also additional mapping types themselves (e.g. classes deriving from ClassMapping)? This way I could extend your mappings and provide mine as well.

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