public async Task <IActionResult> addfactory(Factory factory) { try { await _factory.AddFactoryAsync(factory); var Response = new ResponseViewModel(true, HttpStatusCode.OK, "SUCCESS", factory); return(Ok(Response)); } catch (Exception) { var Response = new ResponseViewModel(false, HttpStatusCode.NoContent, "failed", null); return(Ok(Response)); } }