Interface ISerializerProvider
Provides functionality to get ISerializers by their priorities.
Namespace: Sartorius.SAF.Serialization
Assembly: Sartorius.SAF.dll
Syntax
public interface ISerializerProvider
Methods
View SourceDeserialize<T>(Stream)
Deserializes an object of type T from the specified stream.
Declaration
T Deserialize<T>(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The stream from which the serialized object is read. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | The type to deserialize. |
Remarks
This will try serializers according to their priority.
GetSerializer(Int32)
Gets the ISerializer with the specified priority.
Declaration
ISerializer GetSerializer(int prio)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | prio | The priority. |
Returns
| Type | Description |
|---|---|
| ISerializer | The ISerializer with the specified priority; |
Serialize(Stream, Object)
Serializes the specified graph to the specified stream.
Declaration
void Serialize(Stream stream, object graph)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The stream in which the serialized object is written. |
| System.Object | graph | The graph to serialize. |
Remarks
This will always use the serializer with the top priority.