Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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));
 }
Ejemplo n.º 5
0
 public GetAllModelsFromEntityByPageQuery(IPageDescriptor pageDescriptor)
 {
     PageDescriptor = pageDescriptor;
 }