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