public FindSaucerConfigurationsResponse Find(FindSaucerConfigurationsRequest request)
        {
            try
            {
                _saucerConfigurationQuery.WithOnlyActivated(true);
                _saucerConfigurationQuery.WithOnlyStatusActivated(request.OnlyStatusActivated);
                _saucerConfigurationQuery.WithOnlyStatusDeactivated(request.OnlyStatusDeactivated);
                _saucerConfigurationQuery.WithSaucer(request.SaucerId);
                _saucerConfigurationQuery.WithIngredient(request.IngredientId);
                _saucerConfigurationQuery.Sort(request.Sort, request.SortBy);
                var totalRecords = _saucerConfigurationQuery.TotalRecords();
                _saucerConfigurationQuery.Paginate(request.StartPage, request.EndPage);
                var saucers = _saucerConfigurationQuery.Execute();

                return(new FindSaucerConfigurationsResponse
                {
                    SaucerConfigurations = TypeAdapter.Adapt <List <SaucerConfigurationResponse> >(saucers),
                    TotalRecords = totalRecords
                });
            }
            catch (DataAccessException)
            {
                throw new ApplicationException();
            }
        }
예제 #2
0
 public FindSaucerConfigurationsResponse Get(FindSaucerConfigurationsRequest request)
 {
     return(_saucerConfigurationService.Find(request));
 }