What is the meaning of the “Pluralize or singularize generated object names” setting?

后端 未结 2 945
野的像风
野的像风 2021-02-19 03:16

When setting up a new Entity data Model, there is an option to

[x] Pluralize or singularize generated object names

I have noticed th

2条回答
  •  既然无缘
    2021-02-19 03:42

    If you check Pluralize or singularize generated object names, the set in the class context.cs genrated by EF will be named in the format:

    public virtual DbSet SomeTableNames { get; set; }
    

    if not check, it'll be named:

    public virtual DbSet SomeTableName { get; set; }
    

    Advantages/Disadvantages IMHO:

    I would like to see collection set be named ending with 's', such as dbset colleciton of Employee class of Employee Table named Employees, so I'll check the option. But I guess maybe someone would like to treat the dbset as a table, so he/she would like to name it same as table name Employee.

提交回复
热议问题