32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
|
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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|