示例#1
0
        public override bool UseWhen()
        {
            // do deep property binding
            if (!(ColumnName.Contains('.')))
            {
                return(false);
            }

            var propertyNames = ColumnName.Split('.');

            if (propertyNames.Count() <= 1)
            {
                throw new Exception(string.Format("Can not find any property represented by deep-binding syntax: \"{0}\"", ColumnName));
            }

            Info = PropertyInfoHelper.GetCaseInsensitivePropertyInfo(TargetType, propertyNames[0]);

            var nextColumnName = string.Join(".", propertyNames.Skip(1).ToList());

            deepAction = ColumnActionFactory.GetAction <ICreatorColumnAction>(Info.PropertyType, nextColumnName);

            if (deepAction == null)
            {
                return(false);
            }

            return(deepAction.UseWhen());
        }
示例#2
0
 public string QualifiedColumnNameForSelect(ISchema schema) =>
 OnSelect == null && !ColumnName.Contains(".")
         ? $"{schema.TableAlias}.{ColumnName}"
         : ColumnName;