29 lines
713 B
C#
29 lines
713 B
C#
using cuqmbr.TravelGuide.Application.Common.Mappings;
|
|
using cuqmbr.TravelGuide.Domain.Entities;
|
|
|
|
namespace cuqmbr.TravelGuide.Application.Buses;
|
|
|
|
public sealed class BusDto : IMapFrom<Bus>
|
|
{
|
|
public Guid Uuid { get; set; }
|
|
|
|
public string Number { get; set; }
|
|
|
|
public string Model { get; set; }
|
|
|
|
public short Capacity { get; set; }
|
|
|
|
public Guid CompanyUuid { get; set; }
|
|
|
|
public void Mapping(MappingProfile profile)
|
|
{
|
|
profile.CreateMap<Bus, BusDto>()
|
|
.ForMember(
|
|
d => d.Uuid,
|
|
opt => opt.MapFrom(s => s.Guid))
|
|
.ForMember(
|
|
d => d.CompanyUuid,
|
|
opt => opt.MapFrom(s => s.Company.Guid));
|
|
}
|
|
}
|