Ejemplo n.º 1
0
        private static RelationPart CreateRelationPart(Relation relation, Column column, RelationPartType type)
        {
            var relationPart = new RelationPart
            {
                Relation = relation,
                Column   = column,
                Type     = type
            };

            column.RelationParts.Add(relationPart);

            return(relationPart);
        }
Ejemplo n.º 2
0
        private static Property AttachRelationProperty(RelationPart relationPart, Column column)
        {
            var property = relationPart.Column.Table.Model
                           .Properties.SingleOrDefault(x =>
                                                       x.Attributes.Any(y =>
                                                                        y is RelationAttribute relationAttribute &&
                                                                        relationAttribute.Table == column.Table.DbName &&
                                                                        relationAttribute.Column == column.DbName));

            property.Column       = column;
            property.Type         = PropertyType.Relation;
            property.RelationPart = relationPart;
            column.RelationProperties.Add(property);

            return(property);
        }