public static IXor2 <IPropertyDescription <TAccessingType, TValue>, IPropertyDescriptionChain <TAccessingType, TValue>, IPropertyOrChainDescription> FromExpression <TAccessingType, TValue>(Expression <Func <TAccessingType, TValue> > exProperty) where TAccessingType : class { var xor = _DescriptionFromExpression <TAccessingType, TValue>(SplitMemberPath.ToMemberExpressions(exProperty)); return(new Xor2 <IPropertyDescription <TAccessingType, TValue>, IPropertyDescriptionChain <TAccessingType, TValue>, IPropertyOrChainDescription>(xor)); }
static public string Property <TOwner, TResult>(Expression <Func <TOwner, TResult> > exProp) { var members = SplitMemberPath.ToMemberExpressions(exProp).ToList(); if (!members.Any()) { throw new InvalidOperationException($"Cannot obtain MemberExpression from {exProp}"); } return(string.Join(".", members.Select(x => x.Member.Name))); }
static public bool IsDirectProperty <TAcess, TPropertyValue>(Expression <Func <TAcess, TPropertyValue> > exProperty) { return(SplitMemberPath.ToMemberExpressions(exProperty).Skip(1).Any()); }
public static string Property <TResult>(Expression <Func <TResult> > exProp) { var members = SplitMemberPath.ToMemberExpressions(exProp).ToList(); return(string.Join(".", members.Select(x => x.Member.Name))); }