Cannot find plural form of table

entity-framework entity-framework-core linq-to-entities

Question

For some reason code-first EF7 (vNext) will not use/find the plural form of my table. I have tried adding the table attribute to the model but it does not solve the problem.

[Table("Units")]
public class Unit

If I name the table Unit then no problem. If I name the table Units then it's not found.

What am I doing wrong or missing?

Thank you.

Popular Answer

For Entity Framework 7 beta1, I solved this issue by this way:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    base.OnModelCreating(modelBuilder);
    modelBuilder.Entity<Unit>().ForRelational(rb =>
    {
        rb.Table("Units");
    });
}


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why