Class MemberHelper
- Namespace
- LinqToDB.Expressions
- Assembly
- linq2db.dll
public static class MemberHelper
- Inheritance
-
MemberHelper
Methods
ConstructorOf(Expression<Func<object>>)
public static ConstructorInfo ConstructorOf(Expression<Func<object>> func)
Parameters
func
Expression<Func<object>>
Returns
ConstructorOf<T>(Expression<Func<T, object>>)
public static ConstructorInfo ConstructorOf<T>(Expression<Func<T, object>> func)
Parameters
func
Expression<Func<T, object>>
Returns
Type Parameters
T
FieldOf<T>(Expression<Func<T, object?>>)
public static FieldInfo FieldOf<T>(Expression<Func<T, object?>> func)
Parameters
func
Expression<Func<T, object>>
Returns
Type Parameters
T
GetMemberInfo(Expression)
Gets the member information from given expression.
public static MemberInfo GetMemberInfo(Expression expr)
Parameters
expr
ExpressionThe expression.
Returns
Remarks
Returns member information for given expressions, e.g.:
- For: x => x.SomeProperty, returns MemberInfo of SomeProperty.
- For: x => x.SomeMethod(), returns MethodInfo of SomeMethod.
- For: x => new { X = x.Name }, return ConstructorInfo of anonymous type.
- For: x => Sql.Property<int>(x, "SomeProperty"), returns MemberInfo of "SomeProperty" if exists on type, otherwise returns DynamicColumnInfo for SomeProperty on given type.
Exceptions
- ArgumentException
Only simple, non-navigational, member names are supported in this context (e.g.: x => Sql.Property(x, "SomeProperty")).
GetMemberInfo(LambdaExpression)
Gets the member information from given lambda expression. GetMemberInfo(Expression)
public static MemberInfo GetMemberInfo(LambdaExpression func)
Parameters
func
LambdaExpressionThe lambda expression.
Returns
Exceptions
- ArgumentException
Only simple, non-navigational, member names are supported in this context (e.g.: x => Sql.Property(x, "SomeProperty")).
GetMemberInfoWithType(Expression)
Gets the member information with type from given expression.
public static MemberHelper.MemberInfoWithType GetMemberInfoWithType(Expression expr)
Parameters
expr
ExpressionThe expression.
Returns
Remarks
Returns member information for given expressions, e.g.:
- For: x => x.SomeProperty, returns MemberInfo of SomeProperty.
- For: x => x.SomeMethod(), returns MethodInfo of SomeMethod.
- For: x => new { X = x.Name }, return ConstructorInfo of anonymous type.
- For: x => Sql.Property<int>(x, "SomeProperty"), returns MemberInfo of "SomeProperty" if exists on type, otherwise returns DynamicColumnInfo for SomeProperty on given type.
Exceptions
- ArgumentException
Only simple, non-navigational, member names are supported in this context (e.g.: x => Sql.Property(x, "SomeProperty")).
GetMemberInfoWithType(LambdaExpression)
Gets the member information with type from given lambda expression. GetMemberInfo(Expression)
public static MemberHelper.MemberInfoWithType GetMemberInfoWithType(LambdaExpression func)
Parameters
func
LambdaExpressionThe lambda expression.
Returns
Exceptions
- ArgumentException
Only simple, non-navigational, member names are supported in this context (e.g.: x => Sql.Property(x, "SomeProperty")).
MemberOf<T>(Expression<Func<T, object?>>)
public static MemberInfo MemberOf<T>(Expression<Func<T, object?>> func)
Parameters
func
Expression<Func<T, object>>
Returns
Type Parameters
T
MemberOf<T, TMember>(Expression<Func<T, TMember>>)
public static MemberInfo MemberOf<T, TMember>(Expression<Func<T, TMember>> func)
Parameters
func
Expression<Func<T, TMember>>
Returns
Type Parameters
T
TMember
MethodOf(Expression<Action>)
public static MethodInfo MethodOf(Expression<Action> func)
Parameters
func
Expression<Action>
Returns
MethodOf(Expression<Func<object?>>)
public static MethodInfo MethodOf(Expression<Func<object?>> func)
Parameters
func
Expression<Func<object>>
Returns
MethodOfGeneric(Expression<Action>)
public static MethodInfo MethodOfGeneric(Expression<Action> func)
Parameters
func
Expression<Action>
Returns
MethodOfGeneric(Expression<Func<object?>>)
public static MethodInfo MethodOfGeneric(Expression<Func<object?>> func)
Parameters
func
Expression<Func<object>>
Returns
MethodOfGeneric<T>(Expression<Func<T, object?>>)
public static MethodInfo MethodOfGeneric<T>(Expression<Func<T, object?>> func)
Parameters
func
Expression<Func<T, object>>
Returns
Type Parameters
T
MethodOfGeneric<T1, T2>(Expression<Func<T1, T2, object?>>)
public static MethodInfo MethodOfGeneric<T1, T2>(Expression<Func<T1, T2, object?>> func)
Parameters
func
Expression<Func<T1, T2, object>>
Returns
Type Parameters
T1
T2
MethodOfGeneric<T1, T2, T3>(Expression<Func<T1, T2, T3, object?>>)
public static MethodInfo MethodOfGeneric<T1, T2, T3>(Expression<Func<T1, T2, T3, object?>> func)
Parameters
func
Expression<Func<T1, T2, T3, object>>
Returns
Type Parameters
T1
T2
T3
MethodOfGeneric<T1, T2, T3, T4>(Expression<Func<T1, T2, T3, T4, object?>>)
public static MethodInfo MethodOfGeneric<T1, T2, T3, T4>(Expression<Func<T1, T2, T3, T4, object?>> func)
Parameters
func
Expression<Func<T1, T2, T3, T4, object>>
Returns
Type Parameters
T1
T2
T3
T4
MethodOf<T>(Expression<Func<T, object?>>)
public static MethodInfo MethodOf<T>(Expression<Func<T, object?>> func)
Parameters
func
Expression<Func<T, object>>
Returns
Type Parameters
T
MethodOf<T1, T2>(Expression<Func<T1, T2, object?>>)
public static MethodInfo MethodOf<T1, T2>(Expression<Func<T1, T2, object?>> func)
Parameters
func
Expression<Func<T1, T2, object>>
Returns
Type Parameters
T1
T2
MethodOf<T1, T2, T3>(Expression<Func<T1, T2, T3, object?>>)
public static MethodInfo MethodOf<T1, T2, T3>(Expression<Func<T1, T2, T3, object?>> func)
Parameters
func
Expression<Func<T1, T2, T3, object>>
Returns
Type Parameters
T1
T2
T3
MethodOf<T1, T2, T3, T4>(Expression<Func<T1, T2, T3, T4, object?>>)
public static MethodInfo MethodOf<T1, T2, T3, T4>(Expression<Func<T1, T2, T3, T4, object?>> func)
Parameters
func
Expression<Func<T1, T2, T3, T4, object>>
Returns
Type Parameters
T1
T2
T3
T4
PropertyOf(Expression<Func<object?>>)
public static PropertyInfo PropertyOf(Expression<Func<object?>> func)
Parameters
func
Expression<Func<object>>
Returns
PropertyOf<T>(Expression<Func<T, object?>>)
public static PropertyInfo PropertyOf<T>(Expression<Func<T, object?>> func)
Parameters
func
Expression<Func<T, object>>
Returns
Type Parameters
T