Пример #1
0
        protected virtual String ParseField(Field field) {
            List<String> parsed = new List<String>();

            if (field.Any(attribute => attribute is Distinct)) {
                parsed.Add("DISTINCT");
            }

            Collection collection = field.FirstOrDefault(statement => statement is Collection) as Collection;

            parsed.Add(collection == null ? String.Format("`{0}`", field.Name) : String.Format("`{0}`.`{1}`", collection.Name, field.Name));

            if (field.Any(attribute => attribute is FieldType)) {
                parsed.Add(this.ParseType(field.First(attribute => attribute is FieldType) as FieldType));
            }

            return String.Join(" ", parsed);
        }