コード例 #1
0
 public SystemFileDataStore(EDataStoreType dataStoreType, string rootPath) : base(rootPath)
 {
     DataStoreType = dataStoreType;
 }
コード例 #2
0
 /// <summary>
 /// Get datastore by type from service provider.
 /// </summary>
 /// <param name="serviceProvider">Current context of services</param>
 /// <param name="dataStoreType">Type of datastore</param>
 /// <returns>Datastore of specified type</returns>
 private static IDataStore GetDataStore(this IServiceProvider serviceProvider, EDataStoreType dataStoreType)
 {
     return(serviceProvider.GetServices <IDataStore>().Single(s => s.DataStoreType == dataStoreType));
 }
コード例 #3
0
 /// <summary>
 /// Bind data store to file system path.
 /// </summary>
 /// <param name="services">Service collection</param>
 /// <param name="dataStoreType">Type of data store</param>
 /// <param name="dataDirectoryPath">Path in filesystem</param>
 private static void BindSystemFileDataStore(this IServiceCollection services, EDataStoreType dataStoreType, string dataDirectoryPath)
 {
     if (!string.IsNullOrEmpty(dataDirectoryPath))
     {
         services.AddScoped <IDataStore, SystemFileDataStore>(o => new SystemFileDataStore(dataStoreType, dataDirectoryPath));
     }
 }
コード例 #4
0
 public SystemFileDataStore(EDataStoreType dataStoreType, string rootPath) : base(rootPath)
 {
     Log.Information($"Create SystemFileDataStore of type {dataStoreType}");
     DataStoreType = dataStoreType;
 }