Prerelease .Net 8
See original GitHub issueI am using the DateOnly and TimeOnly objects that were introduced in .Net 6. The problem is, they are only supported in EF8. For this reason I have updated my project to the preview of .Net 8 and EF8. I wanted to ask if it is possible to create a prerelase that targets the new version?
I updated the EF dependencies to the EF8 prerelease but since then I am getting the following error:
Method not found: 'Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IStateManager.TryGetEntry(Microsoft.EntityFrameworkCore.Metadata.IKey, System.Object[])'.
at Detached.Mappers.EntityFramework.EFMapContext.GetExistingEntry[TEntity,TKey](TKey key)
at Detached.Mappers.EntityFramework.EFMapContext.TrackChange[TTarget,TSource,TKey](TTarget entity, TSource source, TKey key, MapperActionType actionType)
at Detached.Mappers.TypeMappers.Entity.Complex.RootEntityTypeMapper`3.Map(TSource source, TTarget target, IMapContext context)
at Detached.Mappers.TypeMappers.TypeMapper`2.Map(Object source, Object target, IMapContext context)
at Detached.Mappers.Mapper.Map(Object source, Type sourceClrType, Object target, Type targetClrType, IMapContext context)
at Detached.Mappers.EntityFramework.EFMapper.Map[TEntity](DbContext dbContext, Object entityOrDTO, MapParameters parameters)
at Detached.Mappers.EntityFramework.EFMapper.<>c__DisplayClass11_0`1.<MapAsync>b__0()
This is probably due to the changes done here: https://github.com/dotnet/efcore/commit/4dded735c894b5f21ad28f26105dc53268f9834c
If need be, I can gladly create a pull request but I think the issue is more with creating a prerelease version of this package, since we don’t want to update the main package to target a prerelease version. What do you think? Or is there another way that I’m unaware of to get rid of the message?
Issue Analytics
- State:
- Created 2 months ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Hi @jorgeparavicini! I haven’t tried .net 8 yet (I wasn’t even able to provide good support to older versions lately). At the first glance, I think that TimeOnly and DateOnly must be added to Primitive collections in MapperOptions, otherwise, the mapper will treat them as Complex (i.e.: Entities). More info here. I’ll give it a try this night and let you know what happens Thanks for the feedback
Amazing, thanks a ton for the quick response. A deserved star ⭐