我看到了一段混合使用 DbSet
和 DbContext
的代码,但我对 Entity Framework 不是很熟悉。我认为它们是两个不同的东西。有人可以给我简单地解释一下吗?
public class testContext : DbContext
{
public testContext();
public string IPAddress { get; set; }
public DbSet<WSettings> Settings { get; set; }
public string UserName { get; set; }
public override int SaveChanges();
}
DbSet
的类型参数,用复数形式来表示属性名称。例如:public DbSet<Customer> Customers { get; set; }
。 - DavidRR