什么时候
var codeFirstRepositor = new Donors();
var list = codeFirstRepositor.CampaignReps.Select(c => c).ToList();
- 当我在类构造函数中放置一个断点时,
CampaignRep
它根本没有被调用——异常似乎发生在对象实例化之前
语境
public class Donors : DbContext
{
public Donors()
{
// Needed for WCF serialization to work
Configuration.ProxyCreationEnabled = false;
}
public DbSet<CampaignRep> CampaignReps { get; set; }
}
EntitySqlException
'CampaignsReps' is not a member of Transient.collection[MyNameSpace.Donor(Nullable=True,DefaultValue=)]'. To extract a property of a collection element, use a subquery to iterate over the collection. Near escaped identifier, line 1, column 10.
这个错误的原因是什么?