Code: Select all
System.InvalidOperationException: Entity type has no key.
at Devart.Data.Linq.Mapping.l.a(IList`1 A_0)
at Devart.Data.Linq.Mapping.l.a(MetaType A_0)
at Devart.Data.Linq.t.c(MetaType A_0)
at Devart.Data.Linq.Provider.DataProvider.TryGetQueryObjectByKey(Expression query, Object& queryObjectKey)
at Devart.Data.Linq.Provider.DataProvider.BuildQuery(Expression query)
at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Compile(Expression query)
at Devart.Data.Linq.DataQuery`1.i()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Jumbo.Juist.Controllers.BeheerController.ExecuteMedeaExport(AppDataContext context)
Code: Select all
List list = context.V_MedeaExports.Where(x => x.Datum >= DateUtility.GetToday()).ToList();
As an ugly workaround, I set Entity Key to 'true' for "Datum" (which means Date) in the linq2sql properties, but I don't know if this has other undesired consequences...