Show / Hide Table of Contents

    Method IsGenericTypeOfInstance

    IsGenericTypeOfInstance(Type, Object)

    Evaluates whether the provided object instance has a Type with an interface or a base type that has a generic type definition that is equal to this Type.
    Declaration
    public static bool IsGenericTypeOfInstance(this Type genericType, object instance)
    Parameters
    Type Name Description
    Type genericType This generic Type to test for.
    Object instance The object whose Type is checked for compatible generic type definitions.
    Returns
    Type Description
    Boolean true, if instance has a type with a generic type definition equal to this genericType, otherwise false.
    Back to top Copyright © 2017-2018, xplo.re IT Services, Michael Maier. All rights reserved.