我使用EF 6,有两个简单的POCO类,如下所示:
public class Person
{
public int PersonId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class Company
{
public int CompanyId { get; set; }
public string Name { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
和我的背景
public class Context : DbContext
{
public Context() : base("name=codefirst")
{
}
public DbSet<Person> People { get; set; }
public DbSet<Company> Corporation { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
而EF产生的表格: dbo.Companies和 dbo.People
我的问题是为什么一个表名是人和其他表名是公司(我知道为什么是复数).我的意思是,一个表使用属性名称,另一个表使用类名? …