Entity Framework DbSet contains 0 records

自闭症网瘾萝莉.ら 提交于 2020-01-06 15:18:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!