public ActionResult <ResultVM <bool> > Create(ProjectVM projectVM) { ResultVM <bool> resultVM = new ResultVM <bool>(); try { ProjectModel projectModel = new ProjectModel(); mapper.Map(projectVM, projectModel); var result = projectBusiness.CreateProject(projectModel); mapper.Map(result, resultVM); return(resultVM); } catch (Exception ex) { resultVM.Message = ex.Message; resultVM.StatusCode = Convert.ToInt32(Enums.StatusCode.BadRequest); return(StatusCode(StatusCodes.Status400BadRequest, new { Result = resultVM })); } }
// POST api/values public bool Post([FromBody] ProjectDTO value) { return(_projectBusiness.CreateProject(value)); }