Beispiel #1
0
        /// <summary>
        /// Initializes static members of the <see cref="SearchController"/> class.
        /// </summary>
        static SearchController()
        {
            // TODO - Ultimately all of this should be handled by Unity (or some other IoC Container implementation).
            _cache = new MemoryCache();
            var entityTypeResolver   = new StaticEntityTypeResolver();
            var entityTypeRepository = new DSEntityTypeRepository(_cache, entityTypeResolver);
            var processor            = new DSSQLSearchProcessor(_cache, entityTypeRepository);

            _dataAccess = new DataAccessController(_cache, entityTypeRepository, processor);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DSDataContext"/> class.
 /// </summary>
 /// <param name="cacheProvider">Link to a cache provider for the repository.</param>
 /// <param name="apiContext">The current API Context.</param>
 public DSDataContext(IBaseCaching cacheProvider, DSAPIContext apiContext)
 {
     _cache     = cacheProvider;
     APIContext = apiContext;
 }
Beispiel #3
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;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DSEntityTypeRepository"/> class.
 /// </summary>
 /// <param name="cacheProvider">Link to a cache provider for the repository.</param>
 /// <param name="resolver">Link to a resolver for retrieving the entity types.</param>
 public DSEntityTypeRepository(IBaseCaching cacheProvider, IDSEntityTypeResolver resolver)
 {
     _cache    = cacheProvider;
     _resolver = resolver;
 }
Beispiel #5
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;
 }
 public void TestInitialize()
 {
     _entityTypeResolver = new SampleEntityTypeResolver();
     _cache = new MemoryCache();
     _entityTypeRepository = new DSEntityTypeRepository(_cache, _entityTypeResolver);
 }