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

TypeFactory.ToNonNullableType Method

ToNonNullableType(IType)

Returns the non-nullable type from the current IType. If the current type is a non-nullable reference type, returns the current type. If the current type is a System.Nullable<>, i.e. a nullable value type, returns the underlying type.

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

ToNonNullableType(ITypeParameter)

Returns the non-nullable type from the current ITypeParameter. If the current type is a non-nullable reference type, returns the current type.

Declaration
public static ITypeParameter ToNonNullableType(this ITypeParameter type)
Parameters
Type Name Description
ITypeParameter type
Returns
Type Description
ITypeParameter

ToNonNullableType(IArrayType)

Returns the non-nullable type from the current IArrayType. If the current type is non-nullable, returns the current type.

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

ToNonNullableType(IDynamicType)

Returns the non-nullable type from the current IDynamicType. If the current type is non-nullable, returns the current type.

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

ToNonNullableType(INamedType)

Returns the non-nullable type from the current IDynamicType. If the current type is a non-nullable reference type, returns the current type. If current type represents a System.Nullable<> where T is a value-type type parameter, this method returns ITypeParameter. Otherwise, it returns an INamedType.

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