Différencier Tunnel et TunnelFlight

This commit is contained in:
Sébastien ANDRE
2023-06-12 16:02:48 +02:00
parent 7856989866
commit da09a8d23b
14 changed files with 216 additions and 51 deletions

View File

@@ -12,13 +12,11 @@ namespace skydiveLogs_api.DomainBusiness
#region Public Constructors
public TunnelService(IDropZoneRepository dropZoneRepository,
ITunnelFlightepository tunnelFlightRepository,
IDropZoneService dropZoneService,
ICacheService cacheService)
{
_dropZoneRepository = dropZoneRepository;
_dropZoneService = dropZoneService;
_tunnelFlightRepository = tunnelFlightRepository;
_cacheService = cacheService;
}
@@ -37,24 +35,6 @@ namespace skydiveLogs_api.DomainBusiness
return allTunnels.Single(g => g.Id == id);
}
public void AddNewFlight(int tunnelId, TunnelFlight newFlight)
{
var selectedTunnel = _dropZoneService.GetDzById(tunnelId)
.Single(t => new Tunnel
{
Id = t.Id,
Name = t.Name,
Website = t.Website,
Address = t.Address,
Email = t.Email,
Latitude = t.Latitude,
Longitude = t.Longitude
}); ;
newFlight.Tunnel = selectedTunnel;
_tunnelFlightRepository.Add(newFlight);
}
#endregion Public Methods
#region Private Methods
@@ -87,7 +67,6 @@ namespace skydiveLogs_api.DomainBusiness
private readonly ICacheService _cacheService;
private readonly IDropZoneService _dropZoneService;
private readonly IDropZoneRepository _dropZoneRepository;
private readonly ITunnelFlightepository _tunnelFlightRepository;
#endregion Private Fields
}