ViewEngineResult.EnsureSuccessful(IEnumerable<String>) 方法

定义

确保此操作 ViewEngineResult 成功。

public:
 Microsoft::AspNetCore::Mvc::ViewEngines::ViewEngineResult ^ EnsureSuccessful(System::Collections::Generic::IEnumerable<System::String ^> ^ originalLocations);
public Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult EnsureSuccessful (System.Collections.Generic.IEnumerable<string> originalLocations);
public Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult EnsureSuccessful (System.Collections.Generic.IEnumerable<string>? originalLocations);
member this.EnsureSuccessful : seq<string> -> Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult
Public Function EnsureSuccessful (originalLocations As IEnumerable(Of String)) As ViewEngineResult

参数

originalLocations
IEnumerable<String>

SearchedLocations如果 Success 为 ,false则要包含在引发InvalidOperationException的 中。

返回

如果 为 ,则SuccesstrueViewEngineResult

例外

如果 为 ,falseSuccess引发。

适用于