For the list of jumps, return only the id of aircraft, type jump, gear and dz. The mapping will do in the Front layer.

This commit is contained in:
Sébastien André
2021-05-02 14:58:49 +02:00
parent 6bc87611e3
commit 192a985b50
2 changed files with 20 additions and 18 deletions

View File

@@ -6,6 +6,8 @@ namespace skydiveLogs_api.Mapper
{
public class ModelProfile : Profile
{
#region Public Constructors
public ModelProfile()
{
CreateMap<DataContract.JumpReq, Jump>();
@@ -17,7 +19,10 @@ namespace skydiveLogs_api.Mapper
CreateMap<DataContract.ImageReq, UserImage>();
CreateMap<Gear, DataContract.GearResp>();
CreateMap<Jump, DataContract.JumpResp>();
CreateMap<Jump, DataContract.JumpResp>().ForMember(dest => dest.AircraftId, opt => opt.MapFrom(s => s.Aircraft.Id))
.ForMember(dest => dest.DropZoneId, opt => opt.MapFrom(s => s.DropZone.Id))
.ForMember(dest => dest.GearId, opt => opt.MapFrom(s => s.Gear.Id))
.ForMember(dest => dest.JumpTypeId, opt => opt.MapFrom(s => s.JumpType.Id));
CreateMap<JumpType, DataContract.JumpTypeResp>();
CreateMap<Aircraft, DataContract.AircraftResp>();
CreateMap<Aircraft, DataContract.AircraftSimpleResp>();
@@ -29,5 +34,7 @@ namespace skydiveLogs_api.Mapper
CreateMap<SimpleSummary, DataContract.SimpleSummaryResp>();
}
#endregion Public Constructors
}
}