public async Task <IActionResult> DeleteCustomerAsync(Int32 id) { var response = new SingleModelResponse <CustomerViewModel>() as ISingleModelResponse <CustomerViewModel>; try { var entity = await Task.Run(() => { return(_RESTfulAPI_Repository.DeleteCustomer(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()); }