ViewExecutor Class¶
Executes an Microsoft.AspNetCore.Mvc.ViewEngines.IView
.
- Namespace
Microsoft.AspNetCore.Mvc.ViewFeatures
- Assemblies
- Microsoft.AspNetCore.Mvc.ViewFeatures
Methods¶
-
ExecuteAsync
(Microsoft.AspNetCore.Mvc.ActionContext, Microsoft.AspNetCore.Mvc.ViewEngines.IView, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary, Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary, System.String, System.Nullable<System.Int32>)¶ Executes a view asynchronously.
Arguments: - actionContext (Microsoft.AspNetCore.Mvc.ActionContext) – The
Microsoft.AspNetCore.Mvc.ActionContext
associated with the current request. - view (Microsoft.AspNetCore.Mvc.ViewEngines.IView) – The
Microsoft.AspNetCore.Mvc.ViewEngines.IView
. - viewData (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary) – The
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
. - tempData (Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary) – The
Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary
. - contentType (System.String) – The content-type header value to set in the response. If <code>null</code>,
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.DefaultContentType
will be used. - statusCode (System.Nullable<System.Int32>) – The HTTP status code to set in the response. May be <code>null</code>.
Return type: System.Threading.Tasks.Task
Returns: A
System.Threading.Tasks.Task
which will complete when view execution is completed.public virtual Task ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, string contentType, int ? statusCode)
- actionContext (Microsoft.AspNetCore.Mvc.ActionContext) – The
-
Constructors¶
-
ViewExecutor
(Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Mvc.MvcViewOptions>, Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory, Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine, Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory, System.Diagnostics.DiagnosticSource, Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider)¶ Creates a new
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor
.Arguments: - viewOptions (Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Mvc.MvcViewOptions>) – The
Microsoft.Extensions.Options.IOptions`1
. - writerFactory (Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory) – The
Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory
. - viewEngine (Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine) – The
Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine
. - tempDataFactory (Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory) – The
Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory
. - diagnosticSource (System.Diagnostics.DiagnosticSource) – The
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.DiagnosticSource
. - modelMetadataProvider (Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider) – The
Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider
.
public ViewExecutor(IOptions<MvcViewOptions> viewOptions, IHttpResponseStreamWriterFactory writerFactory, ICompositeViewEngine viewEngine, ITempDataDictionaryFactory tempDataFactory, DiagnosticSource diagnosticSource, IModelMetadataProvider modelMetadataProvider)
- viewOptions (Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Mvc.MvcViewOptions>) – The
-
Properties¶
-
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.
DiagnosticSource
¶ Gets the
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.DiagnosticSource
.Return type: System.Diagnostics.DiagnosticSource protected DiagnosticSource DiagnosticSource { get; }
-
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.
TempDataFactory
¶ Gets the
Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory
.Return type: Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory protected ITempDataDictionaryFactory TempDataFactory { get; }
-
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.
ViewEngine
¶ Gets the default
Microsoft.AspNetCore.Mvc.ViewEngines.IViewEngine
.Return type: Microsoft.AspNetCore.Mvc.ViewEngines.IViewEngine protected IViewEngine ViewEngine { get; }
-
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.
ViewOptions
¶ Gets the
Microsoft.AspNetCore.Mvc.MvcViewOptions
.Return type: Microsoft.AspNetCore.Mvc.MvcViewOptions protected MvcViewOptions ViewOptions { get; }
-
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.
WriterFactory
¶ Gets the
Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory
.Return type: Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory protected IHttpResponseStreamWriterFactory WriterFactory { get; }
-