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)))); }
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)); }