var codeFirstRepositor = new Donors();
var list = codeFirstRepositor.CampaignReps.Select(c => c).ToList();
CampaignRep
class constructor it is not called at all - the exception seems to occur before object instantiation public class Donors : DbContext
{
public Donors()
{
// Needed for WCF serialization to work
Configuration.ProxyCreationEnabled = false;
}
public DbSet<CampaignRep> CampaignReps { get; set; }
}
'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?
Remove the Select(c => c) and try again. Also, why do you even have that in your query?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.