DefaultChunkTreeCache.GetOrAdd 方法

定义

获取现有的 ChunkTree,或者创建并添加新的,如果它在缓存中不可用或已过期。

public:
 virtual Microsoft::AspNetCore::Razor::Chunks::ChunkTree ^ GetOrAdd(System::String ^ pagePath, Func<Microsoft::Extensions::FileProviders::IFileInfo ^, Microsoft::AspNetCore::Razor::Chunks::ChunkTree ^> ^ getChunkTree);
public Microsoft.AspNetCore.Razor.Chunks.ChunkTree GetOrAdd (string pagePath, Func<Microsoft.Extensions.FileProviders.IFileInfo,Microsoft.AspNetCore.Razor.Chunks.ChunkTree> getChunkTree);
abstract member GetOrAdd : string * Func<Microsoft.Extensions.FileProviders.IFileInfo, Microsoft.AspNetCore.Razor.Chunks.ChunkTree> -> Microsoft.AspNetCore.Razor.Chunks.ChunkTree
override this.GetOrAdd : string * Func<Microsoft.Extensions.FileProviders.IFileInfo, Microsoft.AspNetCore.Razor.Chunks.ChunkTree> -> Microsoft.AspNetCore.Razor.Chunks.ChunkTree
Public Function GetOrAdd (pagePath As String, getChunkTree As Func(Of IFileInfo, ChunkTree)) As ChunkTree

参数

pagePath
String

Razor 页的应用程序相对路径。

getChunkTree
Func<IFileInfo,ChunkTree>

创建一个新的 ChunkTree的委托。

返回

ChunkTree如果文件位于 pagePath,则为 ,null否则为 。

实现

适用于