public override async Task <PaginatedResultModel <OverlayShapeModel> > Handle(GetOverlayShapesQuery request, CancellationToken cancellationToken) { var query = this.context.OverlayShapes.AsQueryable(); if (!string.IsNullOrWhiteSpace(request.Title)) { query = query.Where(t => t.Title.Contains(request.Title)); } return(await query .OrderByDescending(a => a.Id) .PaginateAsync( t => new OverlayShapeModel(t), request, cancellationToken: cancellationToken)); }
public async Task <PaginatedResultModel <OverlayShapeModel> > Get([FromQuery] GetOverlayShapesQuery request) { return(await this.QueryAsync(request)); }