Example #1
0
        public CollectionResult <ResidentAnalyzes> GetResidentAnalyzesByParams(ResidentAnalyzesFilterParams parameters)
        {
            var appointments = GetAllResidentAnalyzes();

            FillResidentAnalyzesQueryParams(parameters);

            appointments = appointments.Where(parameters.Expression);

            var totalCount = appointments.Count();

            var result = appointments
                         .OrderByDescending(x => x.Date)
                         .Skip(parameters.Skip)
                         .Take(parameters.Take)
                         .AsNoTracking()
                         .ToList();

            var appointmentsResult = new CollectionResult <ResidentAnalyzes>
            {
                Collection = result,
                TotalCount = totalCount
            };

            return(appointmentsResult);
        }
Example #2
0
        public CollectionResult <ResidentAnalyzesDto> GetResidentAnalyzesByParams(ResidentAnalyzesFilterParams filterParams)
        {
            var items = _unitOfWork.ResidentAnalyzesRepository.GetResidentAnalyzesByParams(filterParams);

            var result = new CollectionResult <ResidentAnalyzesDto>
            {
                TotalCount = items.TotalCount,
                Collection = AutoMapper.Mapper.Map <IEnumerable <ResidentAnalyzes>, List <ResidentAnalyzesDto> >(items.Collection)
            };

            return(result);
        }
Example #3
0
        private void FillResidentAnalyzesQueryParams(ResidentAnalyzesFilterParams filterParams)
        {
            var predicate = PredicateBuilder.New <ResidentAnalyzes>(t => t.ResidentId == filterParams.ResidentId);

            filterParams.Expression = predicate;
        }
        public IActionResult GetResidentAnalyzes([FromBody] ResidentAnalyzesFilterParams filterParams)
        {
            var items = _residentAnalyzesService.GetResidentAnalyzesByParams(filterParams);

            return(Json(JsonResultData.Success(items)));
        }