Exemple #1
0
        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));
        }
Exemple #2
0
        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)));
        }
Exemple #3
0
 static public bool IsDirectProperty <TAcess, TPropertyValue>(Expression <Func <TAcess, TPropertyValue> > exProperty)
 {
     return(SplitMemberPath.ToMemberExpressions(exProperty).Skip(1).Any());
 }
Exemple #4
0
        public static string Property <TResult>(Expression <Func <TResult> > exProp)
        {
            var members = SplitMemberPath.ToMemberExpressions(exProp).ToList();

            return(string.Join(".", members.Select(x => x.Member.Name)));
        }