結果セットは空を返し、 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;