Exemple #1
0
        public async Task <HttpResponseMessage> Delete()
        {
            var requestContent = await Request.Content.ReadAsStringAsync();

            int id = JsonConvert.DeserializeObject <int>(requestContent);

            return(Request.CreateResponse(HttpStatusCode.OK, _itemManagement.Delete(id)));
        }
 public async Task <HttpResponseMessage> Delete([FromBody] int id)
 {
     if (_itemManagement.Delete(id))
     {
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     else
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
 }