public HttpResponseMessage Delete(int Id) { ItemResponse <int> response = new ItemResponse <int>(); response.Item = _svc.Delete(Id); return(Request.CreateResponse(HttpStatusCode.OK, new SuccessResponse())); }
public IActionResult Delete(string id) { try { if (string.IsNullOrEmpty(id)) { return(NotFound()); } var user = AppUser(); var item = itemService.Get(id); if (user.Id != Guid.Parse(item.UserId)) { return(BadRequest()); } itemService.Delete(id); return(Ok()); } catch { return(new StatusCodeResult((int)HttpStatusCode.InternalServerError)); } }