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); }
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)); }
public Thesaurus(IThesaurusRepository repository, ThesaurusMultiResult multiResultSetting) : this(repository) { this.multiResultSetting = multiResultSetting; }
public Thesaurus(IThesaurusRepository repository) { this.repository = repository; }
public static IThesaurus GetThesaurus(IThesaurusRepository repository, ThesaurusMultiResult multires) { return(new Thesaurus(repository, multires)); }