Migrations adds the letter S in the table name

Asked

Viewed 27 times

1

I have a model:

public class pimentel
{
    [Key]
    public int id { get; set; }
    public string cod_item_Crm { get; set; }
    public string tag { get; set; }
    public string data_anal { get; set; }
    public string modelo { get; set; }
    public int cod_cli { get; set; }
}

However, when I run the application, the system always looks for the name table pimentels, and if not, it creates a table, but always with the letter "S" at the end.

I can change the model to any other, and always generates with the letter "S" at the end

inserir a descrição da imagem aqui

Hold on, hold on, hold on?

1 answer

2


It is the standard rule of pluralization of class names.

You can disable this in the method OnModelCreating, with the following code

modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.