Différencier Tunnel et TunnelFlight
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user