C# Class NServiceMVC.Formats.FormatManager

Afficher le fichier Open project: gregmac/NServiceMVC Class Usage Examples

Méthodes publiques

Méthode Description
CreateHttpResponse ( string contentType, object model ) : System.Web.Mvc.ActionResult

Creates an ActionResult for the model using the specified contenttype. May return an internal server error if there is a problem encoding, and may return HTTP not acceptable if the content type is unknown.

FormatManager ( NServiceMVC config ) : System
GetContentTypeFromAlias ( string alias ) : string

Attempts to translate a mime-type or shortcut for a mime-type into a real mime-type we can use. Returns the original input if not matched.

TryDeserializeModel ( string input, Type modelType, object &model ) : bool

Private Methods

Méthode Description
CreateContentResult ( string contentType, object model ) : System.Web.Mvc.ContentResult

Tries to create a content result for the model using the specified contenttype. Returns null if it's not possible to create using the specified type. Normally, you should use CreateHttpResponse.

Method Details

CreateHttpResponse() public méthode

Creates an ActionResult for the model using the specified contenttype. May return an internal server error if there is a problem encoding, and may return HTTP not acceptable if the content type is unknown.
public CreateHttpResponse ( string contentType, object model ) : System.Web.Mvc.ActionResult
contentType string
model object
Résultat System.Web.Mvc.ActionResult

FormatManager() public méthode

public FormatManager ( NServiceMVC config ) : System
config NServiceMVC
Résultat System

GetContentTypeFromAlias() public static méthode

Attempts to translate a mime-type or shortcut for a mime-type into a real mime-type we can use. Returns the original input if not matched.
public static GetContentTypeFromAlias ( string alias ) : string
alias string
Résultat string

TryDeserializeModel() public méthode

public TryDeserializeModel ( string input, Type modelType, object &model ) : bool
input string
modelType System.Type
model object
Résultat bool