Search Results for

    Show / Hide Table of Contents

    Class Serializer

    Inheritance
    object
    Serializer
    Implements
    ISerializer
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Utils
    Assembly: LemonEdge.Utils.dll
    Syntax
    public class Serializer : ISerializer

    Constructors

    Serializer()

    Declaration
    public Serializer()

    Properties

    Instance

    Declaration
    public static Serializer Instance { get; }
    Property Value
    Type Description
    Serializer

    Methods

    BytesToString(byte[])

    Converts bytes to string content

    Declaration
    public string BytesToString(byte[] bytes)
    Parameters
    Type Name Description
    byte[] bytes

    The byte array

    Returns
    Type Description
    string

    String content

    Deserialize(Type, byte[]?, IEnumerable<Type>?)

    Deserializes from the specified data into the specified type

    Declaration
    public object? Deserialize(Type type, byte[]? data, IEnumerable<Type>? knownTypes = null)
    Parameters
    Type Name Description
    Type type

    The type the data is a serialization of

    byte[] data

    The serialized stream

    IEnumerable<Type> knownTypes

    Additional known types involved in the original serialization

    Returns
    Type Description
    object

    A new instance of type from the serialized data

    Deserialize(Type, string?, IEnumerable<Type>?)

    Deserializes from the specified string into the specified type

    Declaration
    public object? Deserialize(Type type, string? @string, IEnumerable<Type>? knownTypes = null)
    Parameters
    Type Name Description
    Type type

    The type the string is a serialization of

    string string

    The serialized stream

    IEnumerable<Type> knownTypes

    Additional known types involved in the original serialization

    Returns
    Type Description
    object

    A new instance of type from the serialized string

    Deserialize<T>(byte[]?, IEnumerable<Type>?)

    Deserializes from the specified data into the specified type T

    Declaration
    public T Deserialize<T>(byte[]? data, IEnumerable<Type>? knownTypes = null)
    Parameters
    Type Name Description
    byte[] data

    The serialized stream

    IEnumerable<Type> knownTypes

    Additional known types involved in the original serialization

    Returns
    Type Description
    T

    A new instance of T from the serialized data

    Type Parameters
    Name Description
    T

    The type the data is a serialization of

    Deserialize<T>(string?, IEnumerable<Type>?)

    Deserializes from the specified stream into the specified type T

    Declaration
    public T Deserialize<T>(string? stream, IEnumerable<Type>? knownTypes = null)
    Parameters
    Type Name Description
    string stream

    The serialized stream

    IEnumerable<Type> knownTypes

    Additional known types involved in the original serialization

    Returns
    Type Description
    T

    A new instance of T from the serialized stream

    Type Parameters
    Name Description
    T

    The type the stream is a serialization of

    Serialize(object?, IEnumerable<Type>?)

    Serializes the specified obj into a string stream

    Declaration
    public string Serialize(object? obj, IEnumerable<Type>? knownTypes = null)
    Parameters
    Type Name Description
    object obj

    The object to be serialized

    IEnumerable<Type> knownTypes

    Any known types referenced by the obj to be serialized

    Returns
    Type Description
    string

    A serialized string of the obj

    SerializeToBytes(object?, IEnumerable<Type>?)

    Serializes the specified obj into a byte array stream

    Declaration
    public byte[] SerializeToBytes(object? obj, IEnumerable<Type>? knownTypes = null)
    Parameters
    Type Name Description
    object obj

    The object to be serialized

    IEnumerable<Type> knownTypes

    Any known types referenced by the obj to be serialized

    Returns
    Type Description
    byte[]

    A serialized byte array of the obj

    StringToBytes(string)

    Converts a string to a byte array

    Declaration
    public byte[] StringToBytes(string @string)
    Parameters
    Type Name Description
    string string

    The string

    Returns
    Type Description
    byte[]

    A byte array

    Implements

    ISerializer

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.