session-companion/SessionCompanion/SessionCompanion.Services/Profiles/ShopkeeperItemsProfile.cs
2021-01-22 08:00:03 +01:00

26 lines
813 B
C#

using AutoMapper;
using SessionCompanion.Database.Tables;
using SessionCompanion.ViewModels.ShopkeeperItemsViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Services.Profiles
{
using SessionCompanion.ViewModels.ShopkeeperItemViewModels;
public class ShopkeeperItemsProfile : Profile
{
public ShopkeeperItemsProfile()
{
CreateMap<ShopkeeperItemViewModel, ShopkeeperItem>().ReverseMap();
CreateMap<ShopkeeperItemDetailsViewModel, ShopkeeperItem>()
.ForMember(vm => vm.Armor, conf => conf.MapFrom(item => item.Armor))
.ForMember(vm => vm.Weapon, conf => conf.MapFrom(item => item.Weapon)).ReverseMap();
}
}
}