Skip to main content

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
TypeName
System.Stringformat

Register(String, StreamSerializerDelegate, StreamDeserializerDelegate)

View Source
Declaration
public void Register(string contentType, StreamSerializerDelegate streamSerializer, StreamDeserializerDelegate streamDeserializer)
Parameters
TypeName
System.StringcontentType
ServiceStack.Web.StreamSerializerDelegatestreamSerializer
ServiceStack.Web.StreamDeserializerDelegatestreamDeserializer

RegisterAsync(String, StreamSerializerDelegateAsync, StreamDeserializerDelegateAsync)

View Source
Declaration
public void RegisterAsync(string contentType, StreamSerializerDelegateAsync streamSerializer, StreamDeserializerDelegateAsync streamDeserializer)
Parameters
TypeName
System.StringcontentType
ServiceStack.Web.StreamSerializerDelegateAsyncstreamSerializer
ServiceStack.Web.StreamDeserializerDelegateAsyncstreamDeserializer

Remove(String)

View Source
Declaration
public void Remove(string contentType)
Parameters
TypeName
System.StringcontentType

SetContentTypeSerializer(String, StreamSerializerDelegate)

View Source
Declaration
public void SetContentTypeSerializer(string contentType, StreamSerializerDelegate streamSerializer)
Parameters
TypeName
System.StringcontentType
ServiceStack.Web.StreamSerializerDelegatestreamSerializer

SetContentTypeDeserializer(String, StreamDeserializerDelegate)

View Source
Declaration
public void SetContentTypeDeserializer(string contentType, StreamDeserializerDelegate streamDeserializer)
Parameters
TypeName
System.StringcontentType
ServiceStack.Web.StreamDeserializerDelegatestreamDeserializer

SerializeUnknownContentType(IRequest, Object, Stream)

View Source
Declaration
public static async Task SerializeUnknownContentType(IRequest req, object response, Stream stream)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IRequestreq
System.Objectresponse
System.IO.Streamstream

SerializeToBytes(IRequest, Object)

View Source
Declaration
public byte[] SerializeToBytes(IRequest req, object response)
Returns

System.Byte[]

Parameters
TypeName
ServiceStack.Web.IRequestreq
System.Objectresponse

SerializeToString(IRequest, Object)

View Source
Declaration
public string SerializeToString(IRequest req, object response)
Returns

System.String

Parameters
TypeName
ServiceStack.Web.IRequestreq
System.Objectresponse

SerializeToString(IRequest, Object, String)

View Source
Declaration
public string SerializeToString(IRequest req, object response, string contentType)
Returns

System.String

Parameters
TypeName
ServiceStack.Web.IRequestreq
System.Objectresponse
System.StringcontentType

SerializeToStreamAsync(IRequest, Object, Stream)

View Source
Declaration
public Task SerializeToStreamAsync(IRequest req, object response, Stream responseStream)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IRequestreq
System.Objectresponse
System.IO.StreamresponseStream

GetStreamSerializerAsync(String)

View Source
Declaration
public StreamSerializerDelegateAsync GetStreamSerializerAsync(string contentType)
Returns

ServiceStack.Web.StreamSerializerDelegateAsync

Parameters
TypeName
System.StringcontentType

GetStreamSerializer(String)

View Source
Declaration
public StreamSerializerDelegate GetStreamSerializer(string contentType)
Returns

ServiceStack.Web.StreamSerializerDelegate

Parameters
TypeName
System.StringcontentType

DeserializeFromString(String, Type, String)

View Source
Declaration
public object DeserializeFromString(string contentType, Type type, string request)
Returns

System.Object

Parameters
TypeName
System.StringcontentType
System.Typetype
System.Stringrequest

DeserializeFromStream(String, Type, Stream)

View Source
Declaration
public object DeserializeFromStream(string contentType, Type type, Stream fromStream)
Returns

System.Object

Parameters
TypeName
System.StringcontentType
System.Typetype
System.IO.StreamfromStream

GetStreamDeserializer(String)

View Source
Declaration
public StreamDeserializerDelegate GetStreamDeserializer(string contentType)
Returns

ServiceStack.Web.StreamDeserializerDelegate

Parameters
TypeName
System.StringcontentType

GetStreamDeserializerAsync(String)

View Source
Declaration
public StreamDeserializerDelegateAsync GetStreamDeserializerAsync(string contentType)
Returns

ServiceStack.Web.StreamDeserializerDelegateAsync

Parameters
TypeName
System.StringcontentType

Implements