结果集返回空,并且当我使用 Where 子句(LINQ)时出现错误“枚举未产生结果”。可能是什么问题?
public class Stores
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int StoreId { get; set; }
public string StoreName { get; set; }
public string Address { get; set; }
public string Telephone { get; set; }
public int TownId { get; set; }
}
public DbSet<Stores> Store { get; set; }
var storeList = from n in db.Store
where n.TownId == 10
select n;