question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prerelease .Net 8

See original GitHub issue

I 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:closed
  • Created 2 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
leonardoporrocommented, Jul 26, 2023

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

0reactions
jorgeparavicinicommented, Jul 28, 2023

Amazing, thanks a ton for the quick response. A deserved star ⭐

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's new in .NET 8
Learn about the new .NET features introduced in .NET 8. ... This information relates to a pre-release product that may be substantially ...
Read more >
Announcing .NET 8 Preview 1
NET 8 preview and release candidate builds will be delivered monthly. As usual, the final release will be delivered sometime in November at...
Read more >
Releases · dotnet/core
Home repository for .NET Core. Contribute to dotnet/core development by creating an account on GitHub.
Read more >
Releases · dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI - Releases · dotnet/sdk. ... Pre-release ......
Read more >
Terminal.Core 1.0.8-prerelease
Terminal Core. Internal cross-platform library for trading and analysis. Has references from other apps in this list.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found