The simplest example of this, I get a collection and try to output it through the Web API:
// GET api/items public IEnumerable<Item> Get() { return MyContext.Items.ToList(); }
And I get the error message:
Type object
'System.Data.Objects.ObjectQuery`1 [Dcip.Ams.BO.EquipmentWarranty] cannot be converted to type
'System.Data.Entity.DbSet`1 [Dcip.Ams.BO.EquipmentWarranty]
This is a fairly common error related to new proxies, and I know that I can fix it by installing:
MyContext.Configuration.ProxyCreationEnabled = false;
But this strikes the goal of many of my attempts. Is there a better way?
asp.net-web-api entity-framework entity-framework-4
naspinski Dec 19 '12 at 18:48 2012-12-19 18:48
source share