Beispiel #1
0
        public async Task <ActionResult> GetMostValuableRobotsAsync([FromBody] RobotMostValuableFilterParamsDto filterParams)
        {
            BuildUserPrincipal();

            filterParams.UserId = ApiUser.Id;

            var robots = await _robotService.GetMostValuableRobotByFilterParamsAsync(filterParams);

            return(Json(JsonResultData.Success(robots.Where(t => t.Id != filterParams.CurrentRobotId))));
        }
Beispiel #2
0
        public async Task <IEnumerable <GetValuableRobotModelDto> > GetMostValuableRobotByFilterParamsAsync(RobotMostValuableFilterParamsDto filterParamsDto,
                                                                                                            CancellationToken ct = default)
        {
            var filterParams = _mapper.Map <RobotMostValuableFilterParams>(filterParamsDto);

            var robotModels =
                await _unitOfWork.RobotRepository.GetMostValuableRobotByFilterParamsAsync(filterParams, ct);

            return(_mapper.Map <IEnumerable <GetValuableRobotModelDto> >(robotModels));
        }