2022-05-10 16:49:42 -07:00
|
|
|
using API.Dtos;
|
|
|
|
using AutoMapper;
|
|
|
|
using Core.Entities;
|
2022-05-19 19:33:40 -07:00
|
|
|
using Core.Entities.Identity;
|
2022-05-10 16:49:42 -07:00
|
|
|
|
|
|
|
namespace API.Helpers
|
|
|
|
{
|
|
|
|
public class MappingProfiles : Profile
|
|
|
|
{
|
|
|
|
public MappingProfiles()
|
|
|
|
{
|
|
|
|
CreateMap<Product, ProductToReturnDto>()
|
|
|
|
.ForMember(d => d.ProductBrand, o => o.MapFrom(s => s.ProductBrand.Name))
|
2022-05-10 22:43:36 -07:00
|
|
|
.ForMember(d => d.ProductType, o => o.MapFrom(s => s.ProductType.Name))
|
|
|
|
.ForMember(d => d.PictureUrl, o => o.MapFrom<ProductUrlResolver>());
|
2022-05-19 19:33:40 -07:00
|
|
|
|
|
|
|
CreateMap<Address, AddressDto>().ReverseMap();
|
2022-05-20 11:09:24 -07:00
|
|
|
CreateMap<CustomerBasketDto, CustomerBasket>();
|
|
|
|
CreateMap<BasketItemDto, BasketItem>();
|
2022-05-10 16:49:42 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|