Sky.Net/API/Helpers/MappingProfiles.cs

16 lines
413 B
C#
Raw Normal View History

2022-05-10 16:49:42 -07:00
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));
}
}
}