public async Task <PagedValueResult <ToDoListModel> > SearchAsync(IPageDescriptor page, CancellationToken cancellationToken = default) { var spec = this.specificationBuilder.Create <ToDoListModel>(page.Filters); var query = new PagedValueInquiry <ToDoList, ToDoListModel>() { Take = page.Take, Skip = page.Skip, TargetSpecification = spec, TargetSorts = page.Sorts, }; var result = await this.entityRepository.RunQueryAsync(query, cancellationToken); return(result); }
public IPagedQueryResult <PostModel> Find(IPageDescriptor model, string omnisearch) { var spec = Specification <Post> .True; //Specification<Post> spec = TrueSpecification<Post>.Default; if (!omnisearch.IsNullOrEmpty()) { spec = new Specification <Post>(x => x.Content.Contains(omnisearch)); } return(null); //return this.Query<PostModel>(model, spec); }
public async Task <PagedValueResult <T> > SearchAsync <T>(int todoListId, IPageDescriptor page, CancellationToken cancellationToken) where T : class { var spec = this.specificationBuilder.Create <ToDoItem>(page.Filters); spec = spec.And(new Specification <ToDoItem>(x => x.ToDoListId == todoListId)); var query = new PagedValueInquiry <ToDoItem, T>() { Take = page.Take, Skip = page.Skip, SourceSpecification = spec, SourceSorts = page.Sorts, }; var result = await this.repository.RunQueryAsync(query, cancellationToken); return(result); }
protected override Java.Lang.Object CreateFragment(IPageDescriptor desc) { return(EditorFragment.NewInstance(desc.Title)); }
public GetAllModelsFromEntityByPageQuery(IPageDescriptor pageDescriptor) { PageDescriptor = pageDescriptor; }