예제 #1
0
 /// <summary>
 /// Initializes the storage provider.
 /// </summary>
 /// <param name="name">The name of this provider instance.</param>
 /// <param name="providerRuntime">A Orleans runtime object managing all storage providers.</param>
 /// <param name="config">Configuration info for this provider instance.</param>
 /// <returns>Completion promise for this operation.</returns>
 public override Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config)
 {
     this.Name = name;
     this.ConnectionString = config.Properties["ConnectionString"];
     this.Database = config.Properties["Database"];
     if (string.IsNullOrWhiteSpace(ConnectionString)) throw new ArgumentException("ConnectionString property not set");
     if (string.IsNullOrWhiteSpace(Database)) throw new ArgumentException("Database property not set");
     DataManager = new GrainStateMongoDataManager(Database, ConnectionString);
     return base.Init(name, providerRuntime, config);
 }
 /// <summary>
 /// Initializes the storage provider.
 /// </summary>
 /// <param name="name">The name of this provider instance.</param>
 /// <param name="providerRuntime">A Orleans runtime object managing all storage providers.</param>
 /// <param name="config">Configuration info for this provider instance.</param>
 /// <returns>Completion promise for this operation.</returns>
 public override Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config)
 {
     Name             = name;
     ConnectionString = config.Properties["ConnectionString"];
     Database         = config.Properties["Database"];
     if (string.IsNullOrWhiteSpace(ConnectionString))
     {
         throw new ArgumentException("ConnectionString property not set");
     }
     if (string.IsNullOrWhiteSpace(Database))
     {
         throw new ArgumentException("Database property not set");
     }
     DataManager = new GrainStateMongoDataManager(Database, ConnectionString);
     return(base.Init(name, providerRuntime, config));
 }