neisbut / EntityFramework.MemoryJoin

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

Fix .NET 7.0 #31

Open AlexanderPro opened 1 year ago

AlexanderPro commented 1 year ago

Hi,

The library has an exception for .NET 7.0. This PR should fix it.

System.MissingMethodException: Method not found: 'System.String Microsoft.EntityFrameworkCore.RelationalPropertyExtensions.GetColumnName(Microsoft.EntityFrameworkCore.Metadata.IProperty)'.
   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 EntityFrameworkCore.MemoryJoin.MemoryJoiner.FromLocalList[T](DbContext context, IList`1 data, Type queryClass, ValuesInjectionMethod method)
   at EntityFrameworkCore.MemoryJoin.MemoryJoiner.FromLocalList[T](DbContext context, IList`1 data, Type queryClass)
   at EntityFrameworkCore.MemoryJoin.MemoryJoiner.FromLocalList[T](DbContext context, IList`1 data)
johnkwaters commented 1 year ago

I am running into the same error with .net 7 - any chance this PR can get approved?

pacoteinnov commented 1 year ago

For those that can migrate to another library, https://github.com/Noticia-Systems/Noticia.EntityFrameworkCore.MemoryJoin supports .NET7. It is based on EntityFramework.MemoryJoin and the queries are parametrized.