Skip to end of metadata
Go to start of metadata

Type extensions.

Definition

public static class TypeExtensions

Summary

The following table summarizes the members exposed in this class.

Static Methods

GetAttribute<T>(MemberInfo) Gets specific attribute of a member.
GetAttributes<T>(MemberInfo) Gets the attributes of the specified member.
GetItemType(Type) Gets the type of the item.
GetNestedProperty(Type, string) Gets the nested property of the specified property.
GetNestedPropertyType(Type, string) Gets the type of the nested property.

Static Methods

public static T GetAttribute<T>(MemberInfo info)

Gets specific attribute of a member.

Type Parameters

T

Parameters

info Member info.

Return Types

Information about specific member's attribute.

public static IEnumerable<T> GetAttributes<T>(MemberInfo info)

Gets the attributes of the specified member.

Type Parameters

T The 1st type parameter.

Parameters

info Info.

Return Types

The attributes.

public static Type GetItemType(Type source)

Gets the type of the item.

Parameters

source Source.

Return Types

The item type.

public static PropertyInfo GetNestedProperty(Type source, string propertyName)

Gets the nested property of the specified property.

Parameters

source Source.
propertyName Property name.

Return Types

The nested property.

public static Type GetNestedPropertyType(Type source, string propertyName)

Gets the type of the nested property.

Parameters

source Source.
propertyName Property name.

Return Types

The nested property type.
  • No labels