HelperResult Class

Summary

Represents a deferred write operation in a Microsoft.AspNet.Mvc.Razor.RazorPage.

Syntax

public class HelperResult : IHtmlContent

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.Razor.HelperResult

Constructors

HelperResult(System.Func<System.IO.TextWriter, System.Threading.Tasks.Task>)

Creates a new instance of Microsoft.AspNet.Mvc.Razor.HelperResult.

Arguments:
  • asyncAction (System.Func{System.IO.TextWriter,System.Threading.Tasks.Task}) – The asynchronous delegate to invoke when is called.
public HelperResult(Func<TextWriter, Task> asyncAction)

Methods

WriteTo(System.IO.TextWriter, Microsoft.Extensions.WebEncoders.IHtmlEncoder)

Method invoked to produce content from the Microsoft.AspNet.Mvc.Razor.HelperResult.

Arguments:
  • writer (System.IO.TextWriter) – The instance to write to.
  • encoder (Microsoft.Extensions.WebEncoders.IHtmlEncoder) – The to encode the content.
public virtual void WriteTo(TextWriter writer, IHtmlEncoder encoder)

Properties

WriteAction()

Gets the asynchronous delegate to invoke when Microsoft.AspNet.Mvc.Razor.HelperResult.WriteTo(System.IO.TextWriter,Microsoft.Extensions.WebEncoders.IHtmlEncoder) is called.

Return type:System.Func{System.IO.TextWriter,System.Threading.Tasks.Task}
public Func<TextWriter, Task> WriteAction { get; }