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

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

            return(Request.CreateResponse(HttpStatusCode.OK, _invoiceManagement.Delete(id)));
        }
示例#2
0
 public async Task <HttpResponseMessage> Delete(int id)
 {
     if (_invoiceManagement.Delete(id))
     {
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     else
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
 }