예제 #1
0
        /// <summary>
        /// Generate a Search Builder instance based on the supplied information.
        /// </summary>
        /// <param name="entityTypeRepository">List of entity definitions known to the system.</param>
        /// <param name="search">Search instance to build.</param>
        /// <param name="searchParser">Output parameter to return the initialized Search Parser.</param>
        /// <param name="parameterize">When true, will parameterize the search, otherwise will not.</param>
        /// <returns>Search Builder instance run against supplied Search.</returns>
        public static IDSSearchBuilder CreateSearchBuilder(IDSEntityTypeRepository entityTypeRepository, DSSearch search, out DSSearchParser searchParser, bool parameterize = false)
        {
            var queryBuilder = new DSSQLSearchBuilder(parameterize);

            searchParser = new DSSearchParser(entityTypeRepository, queryBuilder);
            searchParser.BuildSearch(search);

            return(queryBuilder);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DSSearchParser"/> class.
 /// </summary>
 /// <param name="entityTypeRepository">List of entity definitions known to the system.</param>
 /// <param name="searchBuilder">Builder that will handle putting together the search from the parts.</param>
 public DSSearchParser(IDSEntityTypeRepository entityTypeRepository, IDSSearchBuilder searchBuilder)
 {
     _entityTypeRepository = entityTypeRepository;
     _searchBuilder        = searchBuilder;
 }
예제 #3
0
        /// <summary>
        /// Generate a Search Builder instance based on the supplied information.
        /// </summary>
        /// <param name="entityTypeRepository">List of entity definitions known to the system.</param>
        /// <param name="search">Search instance to build.</param>
        /// <param name="parameterize">When true, will parameterize the search, otherwise will not.</param>
        /// <returns>Search Builder instance run against supplied Search.</returns>
        public static IDSSearchBuilder CreateSearchBuilder(IDSEntityTypeRepository entityTypeRepository, DSSearch search, bool parameterize = false)
        {
            DSSearchParser searchParser;

            return(CreateSearchBuilder(entityTypeRepository, search, out searchParser, parameterize));
        }
예제 #4
0
        public void TestInitialize()
        {
            var entityTypeResolver = new SampleEntityTypeResolver();

            _entityTypeRepository = new DSEntityTypeRepository(new MemoryCache(), entityTypeResolver);
        }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DSSQLSearchProcessor"/> class.
 /// </summary>
 /// <param name="cacheProvider">Link to a cache provider for the repository.</param>
 /// <param name="entityTypeRepository">Definitions of all available entities in system.</param>
 public DSSQLSearchProcessor(IBaseCaching cacheProvider, IDSEntityTypeRepository entityTypeRepository)
 {
     _cache = cacheProvider;
     _entityTypeRepository = entityTypeRepository;
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataAccessController"/> class.
 /// </summary>
 /// <param name="cacheProvider">Link to a cache provider for the repository.</param>
 /// <param name="entityTypeRepository">Definitions of all available entities in system.</param>
 /// <param name="processor">The Search Processor to utilize.</param>
 public DataAccessController(IBaseCaching cacheProvider, IDSEntityTypeRepository entityTypeRepository, IDSSearchProcessor processor)
 {
     _cache = cacheProvider;
     _entityTypeRepository = entityTypeRepository;
     _processor            = processor;
 }