JonPSmith / EfCore.GenericServices

A library to help you quickly code CRUD accesses for a web/mobile/desktop application using EF Core.
https://www.thereformedprogrammer.net/genericservices-a-library-to-provide-crud-front-end-services-from-a-ef-core-database/
MIT License
601 stars 94 forks source link

Not compatible with Automapper 11.0.0 #61

Closed Akku-21 closed 1 year ago

Akku-21 commented 2 years ago

Hi there,

I just wanted to let you know, that your latest release 5.1.1 is not compatible with Automapper v 11.0.0.

regards Jan

JonPSmith commented 2 years ago

What do you mean by "...not compatible with Automapper v 11.0.0"? Does it no compile, or fails when used?

Akku-21 commented 2 years ago

It compiles but throws in service registration with a Method not found: 'Void AutoMapper.Profile.ForAllPropertyMaps... Exception.

regards Jan

JonPSmith commented 2 years ago

Difficult - AuthoMapper 11.0.0. doesn't support net6 - see this.

Not going to look at that for a while, so use AuthMapper 10.1.1 for now.

Jerrill commented 2 years ago

Another note to anyone researching this issue. I had upgraded from AutoMapper.Data from version 5.0.0 to 6.0.0 that brings AutoMapper 11.0.1 along with it. Same issue as above.

The following call fails: services.ConfigureGenericServicesEntities(new Type[] { ... }).ScanAssemblesForDtos( ... ).RegisterGenericServices();

System.MissingMethodException HResult=0x80131513 Message=Method not found: 'Void AutoMapper.Profile.ForAllPropertyMaps(System.Func2<AutoMapper.PropertyMap,Boolean>, System.Action2<AutoMapper.PropertyMap,AutoMapper.IMemberConfigurationExpression>)'. Source=GenericServices StackTrace: at GenericServices.Setup.Internal.MappingProfile..ctor(Boolean addIgnoreParts) at GenericServices.Setup.Internal.SetupDtosAndMappings..ctor(IGenericServicesConfig publicConfig) at GenericServices.Setup.ConfigureGenericServices.ScanAssemblesForDtos(IGenericServicesSetupPart1 setupPart1, Assembly[] assembliesToScan) at ... .Startup.ConfigureServices(IServiceCollection services) in C:\ ... \Startup.cs:line ...

Jerrill commented 2 years ago

I just dropped in a PR that resolves this issue.

JonPSmith commented 2 years ago

Hi @Jerrill,

Sorry I missed your comment / PR - I must have been busy around the time an missed this. Sorry about that.

I will updating all my libraries to support NET7 and I will try your PR and see how it goes.

JonPSmith commented 1 year ago

Hi @Jerrill,

Version 5.2.0 of this library is out with your PR. Thanks for your help.