Add the jump type in the tunnel flight

This commit is contained in:
Sébastien ANDRE
2023-08-17 11:29:13 +02:00
parent 9237e14bcf
commit 01fa8b60d0
14 changed files with 100 additions and 66 deletions

View File

@@ -29,6 +29,7 @@ namespace skydiveLogs_api.Infrastructure
BsonMapper.Global.Entity<FavoriteDropZone>().DbRef(x => x.DropZone, "DropZone");
BsonMapper.Global.Entity<TunnelFlight>().DbRef(x => x.Tunnel, "DropZone");
BsonMapper.Global.Entity<TunnelFlight>().DbRef(x => x.JumpType, "JumpType");
BsonMapper.Global.Entity<TunnelFlight>().DbRef(x => x.User, "User");
}

View File

@@ -46,6 +46,7 @@ namespace skydiveLogs_api.Infrastructure
public IEnumerable<TunnelFlight> GetAll(User user)
{
return _col.Include(x => x.Tunnel)
.Include(x => x.JumpType)
.Find(j => j.User.Id == user.Id);
}
@@ -57,6 +58,7 @@ namespace skydiveLogs_api.Infrastructure
public IEnumerable<TunnelFlight> GetBetweenIndex(User user, int beginIndex, int endIndex)
{
return _col.Include(x => x.Tunnel)
.Include(x => x.JumpType)
.Query()
.OrderByDescending(j => j.FlightDate)
.Where(j => j.User.Id == user.Id)
@@ -68,6 +70,7 @@ namespace skydiveLogs_api.Infrastructure
public IEnumerable<TunnelFlight> GetBetweenDate(User user, DateTime beginDate, DateTime endDate)
{
return _col.Include(x => x.Tunnel)
.Include(x => x.JumpType)
.Query()
.OrderByDescending(j => j.FlightDate)
.Where(j => j.FlightDate >= beginDate)

View File

@@ -1,17 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>skydiveLogs_api.Infrastructure</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>skydiveLogs_api.Infrastructure</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.17" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\skydiveLogs-api.DomainService\skydiveLogs-api.DomainService.csproj" />
<ProjectReference Include="..\skydiveLogs-api.Domain\skydiveLogs-api.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.17" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\skydiveLogs-api.DomainService\skydiveLogs-api.DomainService.csproj" />
<ProjectReference Include="..\skydiveLogs-api.Domain\skydiveLogs-api.Domain.csproj" />
</ItemGroup>
</Project>