GetWebAppPageAsync([FromBody] PageRequestFilterDto requestDto, CancellationToken cancellationToken) { var filter = requestDto.Filter.ToObject <PropertyListFilter>(); //filter.SearchText = requestDto.Filter.ToString(); var propertyPage = await new PageResultDto <PropertyWebAppListDto>( filter.Filter(ModelService.Queryable.Where(p => p.IsPublished)) .Include(p => p.PropertyPrice) .Include(p => p.PropertyDetail) .Include(p => p.PropertyLocation) .Select(p => new PropertyWebAppListDto { Id = p.Id, PropertyType = p.PropertyType, PropertyTypeId = p.PropertyTypeId, PropertyLabel = p.PropertyLabel, PropertyLabelId = p.PropertyLabelId, PropertyStatus = p.PropertyStatus, PropertyStatusId = p.PropertyStatusId, Title = p.Title, ZipCode = p.Title, Price = p.PropertyPrice, PriceSymbol = p.PropertyPrice.Currency.Symbol, VideoUrl = p.VideoUrl, Description = p.Description, PropertyLocation = p.PropertyLocation, PropertyDetail = p.PropertyDetail, PropertyUniqId = p.PropertyUniqId, Images = p.PropertyImage.Where(i => !i.Deleted && !i.Is360View).Select(i => new PropertyWebAppImageDto { Id = i.Id, Order = i.Priority, ImagePath = i.ImagePath, TumbPath = i.TumbPath, }).ToList(), PublishingDate = p.PublishingDate, Commission = p.Commission, }), requestDto) .GetPage(cancellationToken); //foreach (var dto in propertyPage.Items) //{ // dto.ImagesId = dto.ImagesId.OrderBy(a => a.Order).ToList(); // dto.ImagesUrl = new List<string>(); // foreach (var i in dto.ImagesId) // { // dto.ImagesUrl.Add( // _pathProvider.GetImageApiPath<PropertyImage>( // nameof(PropertyImage.ImageContentTumblr), i.Id.ToString())); // } //} return(propertyPage); }
public virtual async Task <ActionResult <PageResultDto <TPaginationDto> > > GetPageAsync( [FromBody] PageRequestFilterDto requestDto , CancellationToken cancellationToken) => await GetPageResultAsync(ModelService.Queryable, requestDto, new NullFilter <TEntity>(), cancellationToken);
public override async Task <ActionResult <PageResultDto <ContentPageList> > > GetPageAsync( [FromBody] PageRequestFilterDto requestDto, CancellationToken cancellationToken) => await GetPageResultAsync(ModelService.Queryable, requestDto, requestDto.Filter.ToObject <ContentPageListFilter>(), cancellationToken);
public async Task <ActionResult <PageResultDto <RequestListDto> > > GetOpenRequests([FromBody] PageRequestFilterDto requestDto, CancellationToken cancellationToken) { if (_userProvider.Role != UserGroups.Administrator) { if (!_userProvider.IsAgent || _userProvider.IsResponsible.GetValueOrDefault(false) == false) { return(Forbid()); } } var result = await GetPageResultAsync(ModelService.Queryable, requestDto, requestDto.Filter.ToObject <RequestListFilter>(), cancellationToken); //foreach (var item in result.Value.Items) //{ // if (item.User != null) // item.User.PasswordHash = null; //} return(result); }
public override async Task <ActionResult <PageResultDto <RequestListDto> > > GetPageAsync([FromBody] PageRequestFilterDto requestDto, CancellationToken cancellationToken) { var result = await GetPageResultAsync( ModelService.AsQueryable(i => i.AgentId == _userProvider.AgentId), requestDto, requestDto.Filter.ToObject <RequestListFilter>(), cancellationToken); //foreach (var item in result.Value.Items) //{ // if (item.User != null) // item.User.PasswordHash = null; //} return(result); }