MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeType­FactoryTo­Nullable­Type
Open sandboxFocus

TypeFactory.ToNullableType Method

ToNullableType(IType)

Creates a nullable type from the current IType. If the current type is already nullable, returns the current type. If the type is a value type, returns a System.Nullable<> of this type.

Declaration
public static IType ToNullableType(this IType type)
Parameters
Type Name Description
IType type
Returns
Type Description
IType

ToNullableType(INamedType)

Creates a nullable type from the current INamedType. If the current type is already nullable, returns the current type. If the type is a value type, returns a System.Nullable<> of this type.

Declaration
public static INamedType ToNullableType(this INamedType type)
Parameters
Type Name Description
INamedType type
Returns
Type Description
INamedType

ToNullableType(IArrayType)

Creates a nullable type from the current IArrayType. If the current type is already nullable, returns the current type.

Declaration
public static IArrayType ToNullableType(this IArrayType type)
Parameters
Type Name Description
IArrayType type
Returns
Type Description
IArrayType

ToNullableType(IDynamicType)

Creates a nullable type from the current IDynamicType. If the current type is already nullable, returns the current type.

Declaration
public static IDynamicType ToNullableType(this IDynamicType type)
Parameters
Type Name Description
IDynamicType type
Returns
Type Description
IDynamicType