/// <summary>
/// Add auto-mapping DI.
/// </summary>
/// <param name="thisServiceCollection"></param>
/// <param name="mapperProfile">Class that contains the EF-DTO specific mappings.</param>
/// <returns></returns>
public static IServiceCollection AddMappingServices(this IServiceCollection thisServiceCollection,
Profile mapperProfile)
{
thisServiceCollection.AddAutoMapper();
var mapperconfig = new MapperConfiguration(cfg => { cfg.AddProfile(mapperProfile); });
return thisServiceCollection.AddSingleton(sp => mapperconfig.CreateMapper());
}
--
You received this message because you are subscribed to the Google Groups "AutoMapper-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automapper-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.