session-companion/SessionCompanion/SessionCompanion.Services/Profiles/ShopkeeperProfile.cs

25 lines
828 B
C#
Raw Permalink Normal View History

2021-01-20 18:54:56 +01:00
using AutoMapper;
using SessionCompanion.Database.Tables;
using SessionCompanion.ViewModels.ShopkeeperViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Services.Profiles
{
public class ShopkeeperProfile : Profile
{
public ShopkeeperProfile()
{
CreateMap<ShopkeeperViewModel, Shopkeeper>().ReverseMap();
2021-01-20 20:53:54 +01:00
CreateMap<Shopkeeper, ShopkeeperWithItemsViewModel>()
.ForMember(vm => vm.Items, conf => conf.MapFrom(items => items.ShopkeeperItems)).ReverseMap();
2021-01-22 08:00:03 +01:00
CreateMap<Shopkeeper, ShopkeeperWithItemsDetailsViewModel>()
.ForMember(vm => vm.Items, conf => conf.MapFrom(items => items.ShopkeeperItems)).ReverseMap();
2021-01-20 18:54:56 +01:00
}
}
}