public async Task <SearchResponse <VirtualClosetResponse> > SearchTodoList([FromQuery] long id, [FromQuery] string name, [FromQuery] string category, [FromQuery] bool?favorite)

        {
            var info = new SearchVirtualClosetItemInfo(id, name, category, favorite);

            var results = await _manager.Search(info);

            var responses = await _factory.Create <VirtualCloset, VirtualClosetResponse>(results.Data);

            return(new SearchResponse <VirtualClosetResponse>(responses, results.TotalCount));
        }
Esempio n. 2
0
        public async Task <SearchResponse <VirtualCloset> > Search(SearchVirtualClosetItemInfo info)
        {
            var query = closetContext.VirtualClosetItems
                        .Where(c => c.Name.StartsWith((string)info.Name))
                        .AsQueryable()
                        .AsNoTracking();

            int count = await query.CountAsync();

            List <VirtualCloset> results = await query
                                           .OrderBy(c => c.Id)
                                           .ToListAsync();

            return(new SearchResponse <VirtualCloset>(results, count));
        }
        public async Task <SearchResponse <VirtualCloset> > Search(SearchVirtualClosetItemInfo info)
        {
            Verify.That(info, nameof(info)).IsNotNull();

            return(await virtualClosetDao.Search(info));
        }