Aether Utilities Aether Utilities
Aether Utilities Aether Utilities
DocFX + Singulink = ♥

Search Results for

    Edit this page

    Class TypeExtensions

    Namespace
    AetherUtils.Core.Extensions
    Assembly
    AetherUtils.Core.dll
    Provides extension methods for manipulating generic object types.
    public static class TypeExtensions
    Inheritance
    object
    TypeExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()

    Methods

    CanSerializeJson<T>(T)

    Get a value indicating if this object can be serialized via JSON serializion.
    [UsedImplicitly]
    public static bool CanSerializeJson<T>(this T obj) where T : class

    Parameters

    obj T
    The instance of the object with type T.

    Returns

    bool
    true if the object can be serialized; false otherwise.

    Type Parameters

    T
    The Type of the object to check.

    Exceptions

    ArgumentNullException
    If obj was null.

    CanSerializeXml<T>(T)

    Get a value indicating if this object can be serialized via XML serialization.
    public static bool CanSerializeXml<T>(this T obj) where T : class

    Parameters

    obj T
    The instance of the object with type T.

    Returns

    bool
    true if the object can be serialized; false otherwise.

    Type Parameters

    T
    The Type of the object to check.

    Exceptions

    ArgumentNullException
    If obj was null.

    GetFriendlyName(Type)

    Get the friendly, displayable name for the Type.
    [UsedImplicitly]
    public static string GetFriendlyName(this Type type)

    Parameters

    type Type
    The Type to get the name of.

    Returns

    string
    The friendly name for the Type.

    Exceptions

    ArgumentNullException
    If type was null.

    SerializeJson<T>(T)

    Serializes a .NET object to a JSON string.
    public static string SerializeJson<T>(this T obj) where T : class

    Parameters

    obj T
    An instance of T to serialize.

    Returns

    string
    A JSON string representing the serialized object, obj.

    Type Parameters

    T
    The Type of the object to serialize.

    Exceptions

    ArgumentNullException
    If obj was null.

    SerializeXml<T>(T)

    Serializes a .NET object to an XML string.
    public static string SerializeXml<T>(this T obj) where T : class

    Parameters

    obj T
    An instance of T to serialize.

    Returns

    string
    An XML string representing the serialized object, obj.

    Type Parameters

    T
    The Type of the object to serialize.

    Exceptions

    ArgumentNullException
    If obj was null.
    (c) 2024 Ethan Hann. All rights reserved.