Update the repository and model to have the join between the models

This commit is contained in:
Sébastien André
2019-11-20 17:43:30 +01:00
parent 51f7fc2b7d
commit 29740709c6
7 changed files with 46 additions and 15 deletions

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace skydiveLogs_api.DataContract
{
public class GearReq
{
}
}

View File

@@ -0,0 +1,9 @@
namespace skydiveLogs_api.DataContract
{
public class GearResp
{
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@@ -6,13 +6,13 @@ namespace skydiveLogs_api.DataContract
{
public int Id { get; set; }
public int JumpTypeId { get; set; }
public JumpTypeResp JumpType { get; set; }
public int AircraftId { get; set; }
public AircraftResp Aircraft { get; set; }
public int DropZoneId { get; set; }
public DropZoneResp DropZone { get; set; }
public int GearId { get; set; }
public GearResp Gear { get; set; }
public int ExitAltitude { get; set; }

View File

@@ -1,7 +1,4 @@
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Text;
namespace skydiveLogs_api.Mapper
{
@@ -13,7 +10,9 @@ namespace skydiveLogs_api.Mapper
CreateMap<DataContract.JumpTypeReq, Model.JumpType>();
CreateMap<DataContract.AircraftReq, Model.Aircraft>();
CreateMap<DataContract.DropZoneReq, Model.DropZone>();
CreateMap<DataContract.GearReq, Model.Gear>();
CreateMap<Model.Gear, DataContract.GearResp>();
CreateMap<Model.Jump, DataContract.JumpResp>();
CreateMap<Model.JumpType ,DataContract.JumpTypeResp>();
CreateMap<Model.Aircraft ,DataContract.AircraftResp>();