C# Класс NServiceMVC.Formats.FormatManager

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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.

Описание методов

CreateHttpResponse() публичный Метод

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
Результат System.Web.Mvc.ActionResult

FormatManager() публичный Метод

public FormatManager ( NServiceMVC config ) : System
config NServiceMVC
Результат System

GetContentTypeFromAlias() публичный статический Метод

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
Результат string

TryDeserializeModel() публичный Метод

public TryDeserializeModel ( string input, Type modelType, object &model ) : bool
input string
modelType System.Type
model object
Результат bool