次の方法で共有


CoreOptionsExtension.WithMemoryCache(IMemoryCache) メソッド

定義

このインスタンスと同じオプションを持つすべてのオプションを持つ新しいインスタンスを作成しますが、指定されたオプションが変更されています。 このメソッドを直接呼び出すのは異常です。 代わりに DbContextOptionsBuilder を使用します。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension WithMemoryCache (Microsoft.Extensions.Caching.Memory.IMemoryCache memoryCache);
public virtual Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension WithMemoryCache (Microsoft.Extensions.Caching.Memory.IMemoryCache? memoryCache);
abstract member WithMemoryCache : Microsoft.Extensions.Caching.Memory.IMemoryCache -> Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension
override this.WithMemoryCache : Microsoft.Extensions.Caching.Memory.IMemoryCache -> Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension
Public Overridable Function WithMemoryCache (memoryCache As IMemoryCache) As CoreOptionsExtension

パラメーター

memoryCache
IMemoryCache

変更するオプション。

戻り値

オプションが変更された新しいインスタンス。

適用対象