コード例 #1
0
        public ThesaurusController()
        {
            // TODO: Использовать Ninject.
            var thesauriConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["Thesauri"].ConnectionString;

            Repository = new ThesaurusRepository(thesauriConnectionString, Log);
            ThesaurusAccessor thesaurusAccessor = new ThesaurusAccessor(thesauriConnectionString);


            Service = new ServiceLayer(Repository, Log, thesaurusAccessor);
            Version = new ThesaurusServiceVersion();

            var configValue = WebConfigurationManager.AppSettings["SharedFolderForStoringLargeExportFiles"];

            var folderNameForStoringLargeFile = string.IsNullOrEmpty(configValue)
                ? (Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_DATA", "temp"))
                : configValue;

            ImportExportService = new ThesaurusImportExportService(thesaurusAccessor, folderNameForStoringLargeFile);
        }
コード例 #2
0
        public static IThesaurus GetThesaurus(ThesaurusPersistance thesPersistance, ThesaurusMultiResult multires,
                                              int timeoutMilliseconds)
        {
            IThesaurusRepository repository = null;

            switch (thesPersistance)
            {
            case ThesaurusPersistance.File:
                repository = new ThesaurusRepositoryFile(timeoutMilliseconds); break;

            case ThesaurusPersistance.SqlServer:
                repository = new ThesaurusRepositorySqlServer(timeoutMilliseconds);
                break;

            case ThesaurusPersistance.Redis:
                repository = null; break;
            }
            ;

            return(GetThesaurus(repository, multires));
        }
コード例 #3
0
ファイル: Thesaurus.cs プロジェクト: richard-krv/Thesaurus
 public Thesaurus(IThesaurusRepository repository, ThesaurusMultiResult multiResultSetting) :
     this(repository)
 {
     this.multiResultSetting = multiResultSetting;
 }
コード例 #4
0
ファイル: Thesaurus.cs プロジェクト: richard-krv/Thesaurus
 public Thesaurus(IThesaurusRepository repository)
 {
     this.repository = repository;
 }
コード例 #5
0
 public static IThesaurus GetThesaurus(IThesaurusRepository repository, ThesaurusMultiResult multires)
 {
     return(new Thesaurus(repository, multires));
 }