public async Task <object> Delete(string UID)
        {
            bool isValid = await _companiesService.DeleteCompany(UID);

            _notification.SetNotificationMessage(isValid, Title, UID);

            return(_notification);
        }
 public async Task <IActionResult> Delete(Guid id)
 {
     if (await _companiesService.DeleteCompany(id))
     {
         return(NoContent());
     }
     else
     {
         return(NotFound());
     }
 }
 public ActionResult <DeleteModel> Deletecompany(int companyId)
 {
     try
     {
         return(Ok(_companyService.DeleteCompany(companyId)));
     }
     catch (NotFoundOperationException ex)
     {
         return(NotFound(ex.Message));;
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, $"Something happend: {ex.Message}"));
     }
 }
Exemple #4
0
 public void DeleteCompany(long id)
 {
     _companiesService.DeleteCompany(id);
 }
 public async Task <IHttpActionResult> DeleteCompany(int id)
 {
     return(await GetMyResult(() => _companiesService.DeleteCompany(id)));
 }