16 lines
413 B
C#
16 lines
413 B
C#
|
using API.Dtos;
|
||
|
using AutoMapper;
|
||
|
using Core.Entities;
|
||
|
|
||
|
namespace API.Helpers
|
||
|
{
|
||
|
public class MappingProfiles : Profile
|
||
|
{
|
||
|
public MappingProfiles()
|
||
|
{
|
||
|
CreateMap<Product, ProductToReturnDto>()
|
||
|
.ForMember(d => d.ProductBrand, o => o.MapFrom(s => s.ProductBrand.Name))
|
||
|
.ForMember(d => d.ProductType, o => o.MapFrom(s => s.ProductType.Name));
|
||
|
}
|
||
|
}
|
||
|
}
|