Class TypeExtensions
Inheritance
System.Object
TypeExtensions
Namespace: Paradigm.ORM.Data.Extensions
Assembly: Paradigm.ORM.Data.dll
Syntax
public static class TypeExtensions : object
Methods
| Improve this Doc View SourceGetDefaultValue(Type)
Gets the default value of a given type.
Declaration
public static object GetDefaultValue(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type. |
Returns
Type | Description |
---|---|
System.Object | Default value. |
GetParentTypes(Type)
Gets a list of all the base types and interfaces.
Declaration
public static HashSet<Type> GetParentTypes(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type to extract parents. |
Returns
Type | Description |
---|---|
HashSet<Type> | A lis |
GetPropertyInfo<TType>(Expression<Func<TType, Object>>)
Gets the property information from an expression of the type (x => x.ProperyName).
Declaration
public static PropertyInfo GetPropertyInfo<TType>(Expression<Func<TType, object>> expression)
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TType, System.Object>> | expression | A expression returning a property. |
Returns
Type | Description |
---|---|
PropertyInfo | A |
Type Parameters
Name | Description |
---|---|
TType | A .NET type. |
GetPropertyInfo<TType, TProperty>(Expression<Func<TType, TProperty>>)
Gets the property information from an expression of the type (x => x.ProperyName).
Declaration
public static PropertyInfo GetPropertyInfo<TType, TProperty>(Expression<Func<TType, TProperty>> expression)
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TType, TProperty>> | expression | A expression returning a property of type |
Returns
Type | Description |
---|---|
PropertyInfo | A |
Type Parameters
Name | Description |
---|---|
TType | A .NET type. |
TProperty | The type of a property inside |