Modification Zarghatt

This commit is contained in:
2019-03-14 01:31:56 +01:00
parent ad07674711
commit 30ec8ae90b
9 changed files with 76 additions and 27 deletions

View File

@@ -1,7 +1,9 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using LaDOSE.Business.Interface;
using LaDOSE.Entity;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace LaDOSE.Api.Controllers
@@ -35,5 +37,20 @@ namespace LaDOSE.Api.Controllers
return _service.GetById(id);
}
[HttpGet("{id}/delete")]
public IActionResult Delete(int id)
{
try
{
return _service.Delete((int) id) ? (IActionResult) NoContent() : NotFound();
}
catch (Exception)
{
return BadRequest();
}
}
}
}