Class PropertyExtensions

Namespace
Cratis.Reflection
Assembly
Cratis.Fundamentals.dll

Provides a set of methods for working with PropertyInfo.

public static class PropertyExtensions
Inheritance
PropertyExtensions
Inherited Members

Methods

HasAttribute<T>(PropertyInfo)

Check if a property has an attribute associated with it.

public static bool HasAttribute<T>(this PropertyInfo property) where T : Attribute

Parameters

property PropertyInfo

PropertyInfo to check.

Returns

bool

True if there is an attribute, false if not.

Type Parameters

T

Attribute type to check for.

IsNullable(PropertyInfo)

Check if a property is nullable.

public static bool IsNullable(this PropertyInfo property)

Parameters

property PropertyInfo

PropertyInfo to check.

Returns

bool

True if the property is nullable, false if not.