efcore / EFCore.NamingConventions

Entity Framework Core plugin to apply naming conventions to table and column names (e.g. snake_case)
Apache License 2.0
738 stars 74 forks source link

Name of the tables when there are discriminators #194

Closed dianamazo closed 10 months ago

dianamazo commented 1 year ago

Hello, thank you for your package, I have a concern. when we have a table that works with discriminators and we configure it through fluent api, as in the following example:

public class CollaboratorConfiguration : IEntityTypeConfiguration<Collaborator>
{
    public void Configure(EntityTypeBuilder<Collaborator> builder)
    {
        **builder.HasDiscriminator**(hd => hd.CollaboratorType)
            .HasValue<Assistant>(CollaboratorType.Assistant)
            .HasValue<Auxiliary>(CollaboratorType.Auxiliary)
            .HasValue<Professional>(CollaboratorType.Professional)
            .HasValue<Typer>(CollaboratorType.Typer)
            .HasValue<Responsible>(CollaboratorType.Responsible);

        builder.HasOne<Speciality>()
            .WithMany()
            .HasForeignKey(fk => fk.SpecialityId)
            .OnDelete(DeleteBehavior.Restrict);

        builder.HasIndex(i => i.Identification)
            .IsUnique();
    }
}

At the time of creating the migration it is not able to convert the table name to snake case.

Thanks for your support.

at-besa commented 1 year ago

i guess this is the same as #184

roji commented 10 months ago

Duplicate of #184