Skip to content

Mapster.EFCore does not support .net 6 #394

Closed

Description

@tcattel

Mapster.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

Activity

  1. Philippe-Laval commented on Dec 29, 2021

    @Philippe-Laval
    Contributor

    I have created a pull request with all projects compiled with net6.0.
    In this case, all unit tests are passing including the one you described.

  2. Philippe-Laval commented on Dec 29, 2021

    @Philippe-Laval
    Contributor

    In case, you want to test it : it is here
    https://github.com/Philippe-Laval/Mapster

  3. tcattel commented on Dec 29, 2021

    @tcattel
    Author

    All the test pass

    • except one interminently Explicit_Mapping_Requirement_Throws_Before_Mapping_Attempted
    • 91 warnings that for some can easily be removed
  4. Philippe-Laval commented on Dec 29, 2021

    @Philippe-Laval
    Contributor

    The warning are coming from change in project where code is now copiled with nullable warning, I guess.
    I did not take the time to remove the warning since the source code can be compiled for older targets (where nullable is not defined). I just wanted to use mapster.tool and start using mapster.
    I guess people maintining the project have more knowledge than me.

  5. tcattel commented on Dec 29, 2021

    @tcattel
    Author

    got it

  6. sang-sakarin commented on Feb 7, 2022

    @sang-sakarin

    @Philippe-Laval Can you explain how to install this package from your repository. I wait for long time to accept merge request.

  7. Philippe-Laval commented on Feb 7, 2022

    @Philippe-Laval
    Contributor

    @sang-sakarin Hello ! In fact I was expected to have the maintainer of the project update his code. I guess we should ask him if he can do it.
    For my repository, I didn't create a nuget (I expected we could use the official build), so you have to duplicate the repository, build it and then use the dll or the tool as shown in an two examples in my account.

  8. apphost commented on Jul 28, 2022

    @apphost

    still not fixed yet?

  9. QadiymStewart commented on Aug 8, 2022

    @QadiymStewart

    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_01.<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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions