emonney / QuickApp

ASP.NET Core / Angular startup project template with complete login, user and role management. Plus other useful services for Quick Application Development
https://www.ebenmonney.com/quickapp
MIT License
1.26k stars 594 forks source link

With Automapper 8.0.0 do not work. #124

Closed IngoManthey closed 5 years ago

IngoManthey commented 5 years ago

Hi, When I compile the program with Automapper 8.0.0, I get an error message saying ResolveUsing no longer exists. What can I do? CreateMap<ApplicationRole, RoleViewModel>() .ForMember(d => d.Permissions, map => map.MapFrom(s => s.Claims)) .ForMember(d => d.UsersCount, map => map.ResolveUsing(s => s.Users?.Count ?? 0)) .ReverseMap();

emonney commented 5 years ago

Use MapFrom instead. This is documented in the automapper upgrade guide: http://docs.automapper.org/en/latest/8.0-Upgrade-Guide.html#resolveusing

Get the latest version that reflects this changes: https://github.com/emonney/QuickApp/blob/fe7d4ac1828ebf083034f00f2f8e97a44d75f428/src/QuickApp/ViewModels/AutoMapperProfile.cs#L35