ContentTypes
Assembly: ServiceStack.dll
View Source
Declaration
public class ContentTypes : IContentTypes, IContentTypeWriter, IContentTypeReader
Properties
UnknownContentTypeSerializer
View Source
Declaration
public static StreamSerializerDelegateAsync UnknownContentTypeSerializer { get; set; }
UnknownContentTypeDeserializer
View Source
Declaration
public static StreamDeserializerDelegateAsync UnknownContentTypeDeserializer { get; set; }
ContentTypeFormats
View Source
Declaration
public Dictionary<string, string> ContentTypeFormats { get; }
Fields
Instance
View Source
Declaration
public static ContentTypes Instance
ContentTypeSerializers
View Source
Declaration
public Dictionary<string, StreamSerializerDelegate> ContentTypeSerializers
ContentTypeDeserializers
View Source
Declaration
public Dictionary<string, StreamDeserializerDelegate> ContentTypeDeserializers
ContentTypeSerializersAsync
View Source
Declaration
public Dictionary<string, StreamSerializerDelegateAsync> ContentTypeSerializersAsync
ContentTypeDeserializersAsync
View Source
Declaration
public Dictionary<string, StreamDeserializerDelegateAsync> ContentTypeDeserializersAsync
ContentTypeStringSerializers
View Source
Declaration
public readonly Dictionary<string, StringSerializerDelegate> ContentTypeStringSerializers
ContentTypeStringDeserializers
View Source
Declaration
public readonly Dictionary<string, StringDeserializerDelegate> ContentTypeStringDeserializers
KnownFormats
View Source
Declaration
public static HashSet<string> KnownFormats
Methods
GetFormatContentType(String)
View Source
Declaration
public string GetFormatContentType(string format)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | format |
Register(String, StreamSerializerDelegate, StreamDeserializerDelegate)
View Source
Declaration
public void Register(string contentType, StreamSerializerDelegate streamSerializer, StreamDeserializerDelegate streamDeserializer)
Parameters
Type | Name |
---|---|
System.String | contentType |
ServiceStack.Web.StreamSerializerDelegate | streamSerializer |
ServiceStack.Web.StreamDeserializerDelegate | streamDeserializer |
RegisterAsync(String, StreamSerializerDelegateAsync, StreamDeserializerDelegateAsync)
View Source
Declaration
public void RegisterAsync(string contentType, StreamSerializerDelegateAsync streamSerializer, StreamDeserializerDelegateAsync streamDeserializer)
Parameters
Type | Name |
---|---|
System.String | contentType |
ServiceStack.Web.StreamSerializerDelegateAsync | streamSerializer |
ServiceStack.Web.StreamDeserializerDelegateAsync | streamDeserializer |
Remove(String)
View Source
Declaration
public void Remove(string contentType)
Parameters
Type | Name |
---|---|
System.String | contentType |
SetContentTypeSerializer(String, StreamSerializerDelegate)
View Source
Declaration
public void SetContentTypeSerializer(string contentType, StreamSerializerDelegate streamSerializer)
Parameters
Type | Name |
---|---|
System.String | contentType |
ServiceStack.Web.StreamSerializerDelegate | streamSerializer |
SetContentTypeDeserializer(String, StreamDeserializerDelegate)
View Source
Declaration
public void SetContentTypeDeserializer(string contentType, StreamDeserializerDelegate streamDeserializer)
Parameters
Type | Name |
---|---|
System.String | contentType |
ServiceStack.Web.StreamDeserializerDelegate | streamDeserializer |
SerializeUnknownContentType(IRequest, Object, Stream)
View Source
Declaration
public static async Task SerializeUnknownContentType(IRequest req, object response, Stream stream)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Object | response |
System.IO.Stream | stream |
SerializeToBytes(IRequest, Object)
View Source
Declaration
public byte[] SerializeToBytes(IRequest req, object response)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Object | response |
SerializeToString(IRequest, Object)
View Source
Declaration
public string SerializeToString(IRequest req, object response)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Object | response |
SerializeToString(IRequest, Object, String)
View Source
Declaration
public string SerializeToString(IRequest req, object response, string contentType)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Object | response |
System.String | contentType |
SerializeToStreamAsync(IRequest, Object, Stream)
View Source
Declaration
public Task SerializeToStreamAsync(IRequest req, object response, Stream responseStream)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Object | response |
System.IO.Stream | responseStream |
GetStreamSerializerAsync(String)
View Source
Declaration
public StreamSerializerDelegateAsync GetStreamSerializerAsync(string contentType)
Returns
ServiceStack.Web.StreamSerializerDelegateAsync
Parameters
Type | Name |
---|---|
System.String | contentType |
GetStreamSerializer(String)
View Source
Declaration
public StreamSerializerDelegate GetStreamSerializer(string contentType)
Returns
ServiceStack.Web.StreamSerializerDelegate
Parameters
Type | Name |
---|---|
System.String | contentType |
DeserializeFromString(String, Type, String)
View Source
Declaration
public object DeserializeFromString(string contentType, Type type, string request)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.String | contentType |
System.Type | type |
System.String | request |
DeserializeFromStream(String, Type, Stream)
View Source
Declaration
public object DeserializeFromStream(string contentType, Type type, Stream fromStream)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.String | contentType |
System.Type | type |
System.IO.Stream | fromStream |
GetStreamDeserializer(String)
View Source
Declaration
public StreamDeserializerDelegate GetStreamDeserializer(string contentType)
Returns
ServiceStack.Web.StreamDeserializerDelegate
Parameters
Type | Name |
---|---|
System.String | contentType |
GetStreamDeserializerAsync(String)
View Source
Declaration
public StreamDeserializerDelegateAsync GetStreamDeserializerAsync(string contentType)
Returns
ServiceStack.Web.StreamDeserializerDelegateAsync
Parameters
Type | Name |
---|---|
System.String | contentType |