Share via


CosmosDbContextOptionsBuilder.WithOption Method

Definition

Sets an option by cloning the extension used to store the settings. This ensures the builder does not modify options that are already in use elsewhere.

protected virtual Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder WithOption (Func<Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal.CosmosOptionsExtension,Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal.CosmosOptionsExtension> setAction);
abstract member WithOption : Func<Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal.CosmosOptionsExtension, Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal.CosmosOptionsExtension> -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
override this.WithOption : Func<Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal.CosmosOptionsExtension, Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal.CosmosOptionsExtension> -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
Protected Overridable Function WithOption (setAction As Func(Of CosmosOptionsExtension, CosmosOptionsExtension)) As CosmosDbContextOptionsBuilder

Parameters

setAction
Func<Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal.CosmosOptionsExtension,Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal.CosmosOptionsExtension>

An action to set the option.

Returns

The same builder instance so that multiple calls can be chained.

Applies to