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

32 lines
1.2 KiB
C#
Raw Permalink Normal View History

2020-12-27 19:47:13 +01:00
using System;
using System.Collections.Generic;
using System.Text;
namespace SessionCompanion.Services.Profiles
{
using AutoMapper;
using SessionCompanion.Database.Tables;
using SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels;
public class CharacterOtherEquipmentsProfile : Profile
{
public CharacterOtherEquipmentsProfile()
{
CreateMap<CharacterOtherEquipmentViewModel, CharacterOtherEquipment>().ReverseMap();
CreateMap<CharacterOtherEquipment, CharacterOtherEquipmentWithDetailsViewModel>()
.ForMember(vm => vm.Name, conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Name.ToString()))
.ForMember(
vm => vm.Description,
conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Description.ToString()))
.ForMember(
vm => vm.Cost,
conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Cost))
.ForMember(
vm => vm.CurrencyType,
conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.CurrencyType)).ReverseMap();
}
}
}