ObjectResult Class

Syntax

public class ObjectResult : ActionResult, IActionResult

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.ObjectResult

Constructors

ObjectResult(System.Object)
Arguments:
  • value (System.Object) –
public ObjectResult(object value)

Properties

ContentTypes()
Return type:System.Collections.Generic.IList{MediaTypeHeaderValue}
public IList<MediaTypeHeaderValue> ContentTypes { get; set; }
DeclaredType()
Return type:System.Type
public Type DeclaredType { get; set; }
Formatters()
Return type:System.Collections.Generic.IList{Microsoft.AspNet.Mvc.IOutputFormatter}
public IList<IOutputFormatter> Formatters { get; set; }
StatusCode()

Gets or sets the HTTP status code.

Return type:System.Nullable{System.Int32}
public int ? StatusCode { get; set; }
Value()
Return type:System.Object
public object Value { get; set; }

Methods

ExecuteResultAsync(Microsoft.AspNet.Mvc.ActionContext)
Arguments:
Return type:

System.Threading.Tasks.Task

public override Task ExecuteResultAsync(ActionContext context)
OnFormatting(Microsoft.AspNet.Mvc.ActionContext)

This method is called before the formatter writes to the output stream.

Arguments:
protected virtual void OnFormatting(ActionContext context)
SelectFormatter(Microsoft.AspNet.Mvc.OutputFormatterContext, System.Collections.Generic.IEnumerable<Microsoft.AspNet.Mvc.IOutputFormatter>)
Arguments:
Return type:

Microsoft.AspNet.Mvc.IOutputFormatter

public virtual IOutputFormatter SelectFormatter(OutputFormatterContext formatterContext, IEnumerable<IOutputFormatter> formatters)
SelectFormatterBasedOnTypeMatch(Microsoft.AspNet.Mvc.OutputFormatterContext, System.Collections.Generic.IEnumerable<Microsoft.AspNet.Mvc.IOutputFormatter>)
Arguments:
Return type:

Microsoft.AspNet.Mvc.IOutputFormatter

public virtual IOutputFormatter SelectFormatterBasedOnTypeMatch(OutputFormatterContext formatterContext, IEnumerable<IOutputFormatter> formatters)
SelectFormatterUsingAnyAcceptableContentType(Microsoft.AspNet.Mvc.OutputFormatterContext, System.Collections.Generic.IEnumerable<Microsoft.AspNet.Mvc.IOutputFormatter>, System.Collections.Generic.IEnumerable<MediaTypeHeaderValue>)
Arguments:
  • formatterContext (Microsoft.AspNet.Mvc.OutputFormatterContext) –
  • formatters (System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.IOutputFormatter}) –
  • acceptableContentTypes (System.Collections.Generic.IEnumerable{MediaTypeHeaderValue}) –
Return type:

Microsoft.AspNet.Mvc.IOutputFormatter

public virtual IOutputFormatter SelectFormatterUsingAnyAcceptableContentType(OutputFormatterContext formatterContext, IEnumerable<IOutputFormatter> formatters, IEnumerable<MediaTypeHeaderValue> acceptableContentTypes)
SelectFormatterUsingSortedAcceptHeaders(Microsoft.AspNet.Mvc.OutputFormatterContext, System.Collections.Generic.IEnumerable<Microsoft.AspNet.Mvc.IOutputFormatter>, System.Collections.Generic.IEnumerable<MediaTypeHeaderValue>)
Arguments:
  • formatterContext (Microsoft.AspNet.Mvc.OutputFormatterContext) –
  • formatters (System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.IOutputFormatter}) –
  • sortedAcceptHeaders (System.Collections.Generic.IEnumerable{MediaTypeHeaderValue}) –
Return type:

Microsoft.AspNet.Mvc.IOutputFormatter

public virtual IOutputFormatter SelectFormatterUsingSortedAcceptHeaders(OutputFormatterContext formatterContext, IEnumerable<IOutputFormatter> formatters, IEnumerable<MediaTypeHeaderValue> sortedAcceptHeaders)