public async Task <SalesList> Execute(SearchSalesRequest request)
        {
            try
            {
                var filter = BuildFilter(request);
                var offset = request.Pagination.Offset;
                var limit  = request.Pagination.Limit;

                var query = Collections.Sales.Find(filter).Skip(offset).Limit(limit);
                return(new SalesList()
                {
                    Data = query.ToList(),
                    Pagination = new PaginationOut()
                    {
                        Limit = limit,
                        Offset = offset,
                        Total = await SaleDAO.Queries.Count.Execute(filter)
                    }
                });
            }
            catch (Exception)
            {
                throw;
            }
        }
 public static void ValidateSearchRequest(SearchSalesRequest request)
 {
     try
     {
     }
     catch (Exception)
     {
         throw;
     }
 }
 public async Task <SalesList> SearchSales(SearchSalesRequest request)
 {
     try
     {
         return(await Queries.Search.Execute(request));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static async Task <SalesList> SearchSales(SearchSalesRequest request)
 {
     try
     {
         SaleSearchEntity.ValidateSearchRequest(request);
         return(await SaleUseCases.SearchSales.Execute(request));
     }
     catch (Exception)
     {
         throw;
     }
 }
        private FilterDefinition <Sale> BuildFilter(SearchSalesRequest request)
        {
            var platformFilter = BuildPlatformIdFilter(request.PlatformSaleId);

            return(Builders <Sale> .Filter.And(platformFilter));
        }