NegotiatedResultExtensions.Negotiated

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 NegotiatedResult Negotiated(Controller controller,
	string viewName,
	object data)

Return Value

serialized data

Parameters

controller

viewName
Name of the View to when Accept is text/html

data
Data to return

Example

public ActionResult GetCustomers()
{
     return this.Negotiated("List", repo.Customers.OrderBy( c=> c.Company) )
}

Overloads:


See also:

Class NegotiatedResultExtensions

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic