public IActionResult Delete([FromRoute] int id) { identityService.Username = User.Claims.Single(p => p.Type.Equals("username")).Value; try { facade.Delete(id, identityService.Username); return(NoContent()); } catch (Exception) { return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE)); } }
public IActionResult Delete([FromRoute] int id) { identityService.Username = User.Claims.Single(p => p.Type.Equals("username")).Value; identityService.Token = Request.Headers["Authorization"].FirstOrDefault().Replace("Bearer ", ""); try { facade.Delete(id, identityService.Username); return(NoContent()); } catch (Exception) { return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE)); } }