When
var codeFirstRepositor = new Donors();
var list = codeFirstRepositor.CampaignReps.Select(c => c).ToList();
- When I put a breakpoint inside the
CampaignRepclass constructor it is not called at all - the exception seems to occur before object instantiation
Context
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.
What is the cause of this error?
base()in the constructor, but generally I see no reason to inherit...ObjectContext. :) Nope, I've never used Code First approach, I'm a firm believer of database-first. And that would clarify a lot.