neisbut / EntityFramework.MemoryJoin

Extension for EntityFramework for joins to in-memory data
MIT License
56 stars 24 forks source link

Object reference not set #7

Closed chris-cubhub closed 5 years ago

chris-cubhub commented 5 years ago

I've got a code first model using EntityTypeConfiguration maps that are created through reflection. I've added a DbSet to the AppContext protected DbSet<QueryModelClass> QueryData { get; set; }

I'm getting a "Obect reference not set to an instance of an object" exception when I try to do a join.

   at EntityFramework.MemoryJoin.Internal.EFHelper.GetKeyProperty(DbContext context, Type t)
   at EntityFramework.MemoryJoin.Internal.MappingHelper.GetEntityMapping[T](DbContext context, Type queryClass, Dictionary`2 allowedPropertyMapping)
   at EntityFramework.MemoryJoin.MemoryJoiner.FromLocalList[T](DbContext context, IList`1 data, Type queryClass, ValuesInjectionMethod method)
   at EntityFramework.MemoryJoin.MemoryJoiner.FromLocalList[T](DbContext context, IList`1 data)
   at Data.AppContext.UseInMemoryList[T](List`1 inMemoryList) in H:\Development\Repos\Web\Data\AppContext.cs:line 354
   at Data.Repository`1.UseInMemoryList[TList](List`1 inMemoryList) in 
chris-cubhub commented 5 years ago

Configuration problem on my end.

It would be nice to be able to past a List into this instead of having to convert that into a fake anonymous object.