C# Class Decision.Common.NegotiatedResultExtensions

Extends Controller with Negotiated() ActionResult that does basic content negotiation based on the Accept header.
Mostra file Open project: rabbal/Decision

Public Methods

Method Description
Negotiated ( this controller, object data ) : NegotiatedResult

Return content-negotiated content of the data based on Accept header. Supports: application/json - using JSON.NET text/xml - Xml as XmlSerializer XML text/html - as text, or an optional View text/plain - as text

Negotiated ( this controller, string viewName, object data ) : NegotiatedResult

Return content-negotiated content of the data based on Accept header. Supports: application/json - using JSON.NET text/xml - Xml as XmlSerializer XML text/html - as text, or an optional View text/plain - as text

Method Details

Negotiated() public static method

Return content-negotiated content of the data based on Accept header. Supports: application/json - using JSON.NET text/xml - Xml as XmlSerializer XML text/html - as text, or an optional View text/plain - as text
public static Negotiated ( this controller, object data ) : NegotiatedResult
controller this
data object Data to return
return NegotiatedResult

Negotiated() public static method

Return content-negotiated content of the data based on Accept header. Supports: application/json - using JSON.NET text/xml - Xml as XmlSerializer XML text/html - as text, or an optional View text/plain - as text
public static Negotiated ( this controller, string viewName, object data ) : NegotiatedResult
controller this
viewName string Name of the View to when Accept is text/html
data object Data to return
return NegotiatedResult