public ActionResult <ResultVM <List <ProjectVM> > > GetAll() { ResultVM <List <ProjectVM> > resultVM = new ResultVM <List <ProjectVM> >(); try { var result = projectBusiness.GetAllProjects(); mapper.Map(result, resultVM); return(resultVM); } catch (Exception ex) { Common.LogMessage(ex.Message); resultVM.Message = ex.Message; resultVM.StatusCode = Convert.ToInt32(Enums.StatusCode.BadRequest); return(StatusCode(StatusCodes.Status400BadRequest, new { Result = resultVM, Codes = new string[] { "ServerError" } })); } }
// GET api/values public IEnumerable <ProjectDTO> Get() { return(_projectBusiness.GetAllProjects()); }