Add function to get the tunnel flights between dates
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using skydiveLogs_api.Domain;
|
||||
using skydiveLogs_api.DomainService.Repositories;
|
||||
using skydiveLogs_api.Infrastructure.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace skydiveLogs_api.Infrastructure
|
||||
@@ -64,6 +65,16 @@ namespace skydiveLogs_api.Infrastructure
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public IEnumerable<TunnelFlight> GetBetweenDate(User user, DateTime beginDate, DateTime endDate)
|
||||
{
|
||||
return _col.Include(x => x.Tunnel)
|
||||
.Query()
|
||||
.OrderByDescending(j => j.FlightDate)
|
||||
.Where(j => j.FlightDate >= beginDate)
|
||||
.Where(j => j.FlightDate <= endDate)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public TunnelFlight GetById(int id)
|
||||
{
|
||||
return _col.FindById(new BsonValue(id));
|
||||
|
||||
Reference in New Issue
Block a user