protected override ISiloBuilder PreBuild(ISiloBuilder builder) { OrleansFixture.GetAccountInfo(out this.AccountEndpoint, out this.AccountKey); var httpHandler = new HttpClientHandler() { ServerCertificateCustomValidationCallback = (req, cert, chain, errors) => true }; var dbClient = new CosmosClient( this.AccountEndpoint, this.AccountKey, new CosmosClientOptions { ConnectionMode = ConnectionMode.Gateway } ); return(builder .AddCosmosDBGrainStorage(OrleansFixture.TEST_STORAGE, opt => { opt.Client = dbClient; opt.DropDatabaseOnInit = true; opt.CanCreateResources = true; opt.DB = StorageDbName; opt.StateFieldsToIndex.Add("NftIndexedInt"); opt.StateFieldsToIndex.Add("UserState.FtIndexedString"); })); }
/// <summary> /// Configure silo to use Azure CosmosDB storage as the default grain storage using a custom Partition Key Provider. /// </summary> public static ISiloBuilder AddCosmosDBGrainStorageAsDefault <TPartitionKeyProvider>(this ISiloBuilder builder, Action <OptionsBuilder <CosmosDBStorageOptions> > configureOptions = null) where TPartitionKeyProvider : class, IPartitionKeyProvider { return(builder.AddCosmosDBGrainStorage <TPartitionKeyProvider>(ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME, configureOptions)); }
/// <summary> /// Configure silo to use Azure CosmosDB storage as the default grain storage using a custom Partition Key Provider. /// </summary> public static ISiloBuilder AddCosmosDBGrainStorageAsDefault(this ISiloBuilder builder, Type customPartitionKeyProviderType, Action <OptionsBuilder <CosmosDBStorageOptions> > configureOptions = null) { return(builder.AddCosmosDBGrainStorage(ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME, customPartitionKeyProviderType, configureOptions)); }
/// <summary> /// Configure silo to use Azure CosmosDB storage as the default grain storage. /// </summary> public static ISiloBuilder AddCosmosDBGrainStorageAsDefault(this ISiloBuilder builder, Action <CosmosDBStorageOptions> configureOptions) { return(builder.AddCosmosDBGrainStorage(ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME, configureOptions)); }