Mapster.EFCore does not support .net 6
See original GitHub issueMapster.EFCore.Tests
- change from .netcore3.1 to .net 6
- update nugets
- run EFCoreTest.TestFindObject
-
dto.BuildAdapter() .**EntityFromContext**(context) .AdaptTo(poco);
Test method Mapster.EFCore.Tests.EFCoreTest.TestFindObject threw exception:
System.MissingMethodException: Method not found: ‘System.Type Microsoft.EntityFrameworkCore.Metadata.ITypeBase.get_ClrType()’.
at Mapster.TypeAdapterBuilderExtensions.<>c__DisplayClass0_01.<EntityFromContext>b__0(TypeAdapterConfig config) at Mapster.TypeAdapterConfig.<>c__DisplayClass99_0.<Fork>b__0(String _) in C:\Dev\Github\Mapster\src\Mapster\TypeAdapterConfig.cs:line 705 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Mapster.TypeAdapterConfig.Fork(Action1 action, String key1, Int32 key2) in C:\Dev\Github\Mapster\src\Mapster\TypeAdapterConfig.cs:line 702
at Mapster.TypeAdapterBuilder1.ForkConfig(Action1 action, String key1, Int32 key2) in C:\Dev\Github\Mapster\src\Mapster\TypeAdapterBuilder.cs:line 39
at Mapster.TypeAdapterBuilderExtensions.EntityFromContext[TSource](TypeAdapterBuilder`1 builder, DbContext context) in C:\Dev\Github\Mapster\src\Mapster.EFCore\TypeAdapterBuilderExtensions.cs:line 18
at Mapster.EFCore.Tests.EFCoreTest.TestFindObject() in C:\Dev\Github\Mapster\src\Mapster.EFCore.Tests\EFCoreTest.cs:line 37
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)

Top Related StackOverflow Question
Doesn’t work still getting an error
[2022-08-08T14:42:57.453Z] Error: System.MissingMethodException: Method not found: ‘System.Type Microsoft.EntityFrameworkCore.Metadata.ITypeBase.get_ClrType()’. at Mapster.TypeAdapterBuilderExtensions.<>c__DisplayClass0_0
1.<EntityFromContext>b__0(TypeAdapterConfig config) at Mapster.TypeAdapterConfig.<>c__DisplayClass99_0.<Fork>b__0(String _) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Mapster.TypeAdapterConfig.Fork(Action1 action, String key1, Int32 key2) at Mapster.TypeAdapterBuilderExtensions.EntityFromContext[TSource](TypeAdapterBuilder`1 builder, DbContext context)still not fixed yet?