public JsonResult <List <Models.ProjectDetails> > GetAllProjectDetailsSorted(string sortBy, bool ascending)
        {
            List <DataAccessLayer.ProjectDetail> prodList = ProjectEntities.GetAllProjects().AsQueryable().OrderByPropertyName(sortBy, ascending).ToList();
            var result = new List <DataAccessLayer.ProjectDetail>();

            var projectObject = Mapper.Map <List <DataAccessLayer.ProjectDetail>, List <Models.ProjectDetails> >(prodList);

            return(Json(projectObject));
        }
        public JsonResult <List <Models.ProjectDetails> > GetAllProjectDetails()
        {
            List <DataAccessLayer.ProjectDetail> projectList = ProjectEntities.GetAllProjects();
            List <Models.ProjectDetails>         projects    = new List <Models.ProjectDetails>();


            List <Models.ProjectDetails> projectObj = Mapper.Map <List <DataAccessLayer.ProjectDetail>, List <Models.ProjectDetails> >(projectList);

            return(Json(projectObj));
        }
        public JsonResult <List <Models.ProjectDetails> > GetAllProjectDetailsFiltered([FromBody] SearchSortParameter request)
        {
            var result = ProjectEntities.GetAllProjects();
            List <DataAccessLayer.ProjectDetail>        prodList;
            IEnumerable <DataAccessLayer.ProjectDetail> searchResult;

            if (!string.IsNullOrEmpty(request.Search))
            {
                searchResult = result.Where(x => x.ProjectDesc.Contains(request.Search));
            }
            else
            {
                searchResult = result;
            }

            prodList = searchResult.AsQueryable().OrderByPropertyName(request.SortBy, request.Ascending).ToList();

            var projectObj = Mapper.Map <List <DataAccessLayer.ProjectDetail>, List <Models.ProjectDetails> >(prodList);

            return(Json(projectObj));
        }