コード例 #1
0
ファイル: Property[T].cs プロジェクト: seshuk/chronological
        internal static Property Create <TY>(Expression <Func <TY, T> > property)
        {
            var eventFieldMemberExpression = new EventFieldMemberExpression(property.Body as MemberExpression);

            if (BuiltIn.All().Contains(eventFieldMemberExpression.UnescapedEventFieldName))
            {
                return(Property.BuiltIn(eventFieldMemberExpression.UnescapedEventFieldName));
            }
            return(Property.Custom(eventFieldMemberExpression.UnescapedEventFieldName, eventFieldMemberExpression.EventFieldDataType));
        }
コード例 #2
0
        private string UnescapeEventFieldName(string eventFieldName)
        {
            if (BuiltIn.All().Contains(eventFieldName))
            {
                return(eventFieldName);
            }

            if (eventFieldName.StartsWith("[") && eventFieldName.EndsWith("]"))
            {
                return(eventFieldName.Substring(1, EscapedEventFieldName.Length - 2));
            }

            return(eventFieldName);
        }
コード例 #3
0
        private string EscapeEventFieldName(string eventFieldName)
        {
            if (BuiltIn.All().Contains(eventFieldName))
            {
                return(eventFieldName);
            }

            if (eventFieldName.StartsWith("[") && eventFieldName.EndsWith("]"))
            {
                return(eventFieldName);
            }

            return($"[{eventFieldName}]");
        }