问题
So I have the following problem:
I have some Vehicle entity that corresponds to a table in the DB. But when I try to retrieve ALL the records with the following line :
var vehicles = db.VehicleSet.ToList();
I get ZERO objects as result ... whilst the table in the DB has approx. 18k records.
Any idea where the problem might be, or is the question too vague?
回答1:
I Figured it out. Turns out it was a problem with the Database. In my structure I was using a "Discriminator" field which was not set and was causing problems.
Thank you for your time.
来源:https://stackoverflow.com/questions/21258462/entity-framework-dbset-contains-0-records