What is syntax to map both ways in AutoMapper Net Core2?
I need to map ProductViewModel and ProductDto both ways. This is not working,
Startup.cs
var config = new MapperConfiguration
(
cfg => cfg.CreateMap<Models.ProductDto, Models.ProductViewModel>(),
cfg => cfg.CreateMap<Models.ProductViewModel, Models.ProductDto>()
);
var mapper = config.CreateMapper();
I'd rather create a separate initializer and mapper. e.g here is my
AutoMapperStartupTaskclass.And Mapper
Startup.cs
Use in Controller