public IExampleStorage <TState> Create <TState>(string name, IExampleStorageConfig cfg) { IExampleStorageFactory factory = string.IsNullOrEmpty(name) ? this.services.GetService <IExampleStorageFactory>() : this.services.GetServiceByName <IExampleStorageFactory>(name); if (factory != null) { return(factory.Create <TState>(cfg)); } throw new InvalidOperationException($"Storage feature with name {name} not found."); }
public StorageDefaultFactoryGrain( IExampleStorageFactory ExampleStorageFactory) { this.first = ExampleStorageFactory.Create <string>(new ExampleStorageConfig("FirstState")); this.second = ExampleStorageFactory.Create <string>(new ExampleStorageConfig("second")); }