Exemplo n.º 1
0
        private IQueryable <TDataModel> QuerySearch(DataReducer <TDataModel> reducer)
        {
            Checker.NotNullArgument(reducer, nameof(reducer));

            var reducerList = reducer.GetReducer();

            Checker.NotNullObject(reducerList, $"reducer.{nameof(reducer.GetReducer)}()");

            return(reducerList.Aggregate(Query, (q, w) => q.Where(w)));
        }
Exemplo n.º 2
0
        public AppStoreContainer()
        {
            var reducer = new CompositeReducer <AppState>()
                          .Part(s => s.SearchState, SearchReducer.GetReducer())
                          .Part(s => s.DiscoverState, DiscoverReducer.GetReducer())
                          .Part(s => s.AuthenticationState, AuthenticationReducer.GetReducer())
                          .Part(s => s.FavoriteState, FavouriteReducer.GetReducer())
                          .Part(s => s.DataState, DataReducer.GetReducer())
                          .Part(s => s.MovieDetailsState, MovieDetailsReducer.GetReducer())
                          .Part(s => s.ReviewsState, ReviewsReducer.GetReducer());

            Store = new Store <AppState>(reducer);
        }