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

@@ -19,7 +19,7 @@ namespace skydiveLogs_api.Business
{
var allJumps = _jumpRepository.GetAll();
return allJumps.GroupBy(j => j.AircraftId,
return allJumps.GroupBy(j => j.Aircraft.Id,
j => j,
(groupby, jumps) => new Statistic
{
@@ -33,7 +33,7 @@ namespace skydiveLogs_api.Business
{
var allJumps = _jumpRepository.GetAll();
return allJumps.GroupBy(j => j.DropZoneId,
return allJumps.GroupBy(j => j.DropZone.Id,
j => j,
(groupby, jumps) => new Statistic
{
@@ -47,7 +47,7 @@ namespace skydiveLogs_api.Business
{
var allJumps = _jumpRepository.GetAll();
return allJumps.GroupBy(j => j.JumpTypeId,
return allJumps.GroupBy(j => j.JumpType.Id,
j => j,
(groupby, jumps) => new Statistic
{
@@ -61,7 +61,7 @@ namespace skydiveLogs_api.Business
{
var allJumps = _jumpRepository.GetAll();
return allJumps.GroupBy(j => j.GearId,
return allJumps.GroupBy(j => j.Gear.Id,
j => j,
(groupby, jumps) => new Statistic
{