public async Task <IActionResult> DeleteOrderAsync(Int32 id) { var response = new SingleModelResponse <OrderViewModel>() as ISingleModelResponse <OrderViewModel>; try { var entity = await Task.Run(() => { return(_RESTfulAPI_Repository.DeleteOrder(id)); }); response.Model = entity.ToViewModel(); response.Info = "The record was deleted successfully"; } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.Message; } return(response.ToHttpResponse()); }