RelationalDbContextOptionsBuilder<TBuilder,TExtension>.WithOption 方法

定义

通过克隆用于存储设置的扩展来设置选项。 这可确保生成器不会修改已在其他位置使用的选项。

protected virtual TBuilder WithOption (Func<TExtension,TExtension> setAction);
abstract member WithOption : Func<'Extension, 'Extension (requires 'Extension :> Microsoft.EntityFrameworkCore.Infrastructure.RelationalOptionsExtension and 'Extension : (new : unit -> 'Extension) and 'Extension :> Microsoft.EntityFrameworkCore.Infrastructure.RelationalOptionsExtension and 'Extension : (new : unit -> 'Extension))> -> 'Builder
override this.WithOption : Func<'Extension, 'Extension (requires 'Extension :> Microsoft.EntityFrameworkCore.Infrastructure.RelationalOptionsExtension and 'Extension : (new : unit -> 'Extension) and 'Extension :> Microsoft.EntityFrameworkCore.Infrastructure.RelationalOptionsExtension and 'Extension : (new : unit -> 'Extension))> -> 'Builder
Protected Overridable Function WithOption (setAction As Func(Of TExtension, TExtension)) As TBuilder

参数

setAction
Func<TExtension,TExtension>

用于设置选项的操作。

返回

TBuilder

同一生成器实例,以便可以链接多个调用。

适用于