This commit is contained in:
Sébastien André
2021-04-18 10:49:21 +02:00
parent 9f58e2b31a
commit f671d0b1d0
9 changed files with 95 additions and 90 deletions

View File

@@ -1,18 +1,17 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using AutoMapper;
using Microsoft.AspNetCore.Cors;
using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using skydiveLogs_api.DataContract;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainBusiness.Interfaces;
using skydiveLogs_api.DataContract;
using System.Collections.Generic;
namespace skydiveLogs_api.Controllers
{
public class AircraftController : Base
{
#region Public Constructors
public AircraftController(IAircraftService aircraftService,
IMapper mapper)
{
@@ -20,6 +19,18 @@ namespace skydiveLogs_api.Controllers
_mapper = mapper;
}
#endregion Public Constructors
#region Public Methods
// DELETE: api/ApiWithActions/5
[HttpDelete("{id}")]
[EnableCors]
public void Delete(int id)
{
_aircraftService.DeleteAircraftById(id);
}
// GET: api/Aircraft
[HttpGet]
[EnableCors]
@@ -54,15 +65,13 @@ namespace skydiveLogs_api.Controllers
_aircraftService.UpdateAircraft(id, _mapper.Map<Aircraft>(value));
}
// DELETE: api/ApiWithActions/5
[HttpDelete("{id}")]
[EnableCors]
public void Delete(int id)
{
_aircraftService.DeleteAircraftById(id);
}
#endregion Public Methods
#region Private Fields
private readonly IAircraftService _aircraftService;
private readonly IMapper _mapper;
#endregion Private Fields
}
}
}