Show / Hide Table of Contents

    Class CommsSerializer

    An interface for serializing and deserializing JSON objects. This serializer is used throughout the Communications workload to provide extra functionality. Specifically it supports more robust serialization/deserialization of @odata.type property and deserialization of open type additional data.

    Inheritance
    Object
    CommsSerializer
    Implements
    ISerializer
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.Graph.Communications.Core.Serialization
    Assembly: Microsoft.Graph.Communications.Core.dll
    Syntax
    public class CommsSerializer : ISerializer

    Constructors

    CommsSerializer(Boolean)

    Initializes a new instance of the CommsSerializer class.

    Declaration
    public CommsSerializer(bool pretty = false)
    Parameters
    Type Name Description
    Boolean pretty

    If set to true make the formatting pretty.

    CommsSerializer(Boolean, Assembly[])

    Initializes a new instance of the CommsSerializer class.

    Declaration
    public CommsSerializer(bool pretty = false, params Assembly[] assemblies)
    Parameters
    Type Name Description
    Boolean pretty

    If set to true make the formatting pretty.

    Assembly[] assemblies

    The assemblies to use for deserialization. The CommsSerializer searches through the specified assemblies in order specified to find the @odata.type in the json payload.

    Properties

    CoreAssemblies

    Gets the list of core Assembly detected.

    Declaration
    public Assembly[] CoreAssemblies { get; }
    Property Value
    Type Description
    Assembly[]

    JsonSerializerSettings

    Gets the JSON serializer settings.

    Declaration
    public JsonSerializerSettings JsonSerializerSettings { get; }
    Property Value
    Type Description
    Newtonsoft.Json.JsonSerializerSettings

    Methods

    DeserializeObject<T>(Stream)

    Declaration
    public T DeserializeObject<T>(Stream stream)
    Parameters
    Type Name Description
    Stream stream
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    DeserializeObject<T>(String)

    Declaration
    public T DeserializeObject<T>(string inputString)
    Parameters
    Type Name Description
    String inputString
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    SerializeObject(Object)

    Declaration
    public string SerializeObject(object serializeableObject)
    Parameters
    Type Name Description
    Object serializeableObject
    Returns
    Type Description
    String

    Implements

    Microsoft.Graph.ISerializer

    See Also

    ISerializer
    Back to top Copyright (c) Microsoft Corporation. All rights reserved.