新しい Entity Frameworks Code First アプリを作成しましたが、DbSet (People) が null を返しています。
public class Person
{
public int Id { get; set; }
public string Name { get; set; }
}
public class Repository : DbContext
{
public DbSet<Person> People;
}
web.config : 接続文字列
<connectionStrings>
<add name="Repository"
connectionString="Data Source=|DataDirectory|Repository.sdf"
providerName="System.Data.SqlServerCe.4.0"/>
</connectionStrings>
今私が電話するとき
Repository _repo = new Repository()
_repo.People;
_repo.People
nullになります
私は何が欠けていますか?
- Microsoft.Data.Entity.Ctp.dll が参照されています
- データベース初期化子の有無にかかわらず試しました。