示例#1
0
        private void AddEntitiesAndRelationships(EntitySet entitySet)
        {
            foreach (var entity in entitySet.Entities.OrderBy(e => e.Name))
            {
                controller.AddEntity(entity);
            }

            // Have to add all entities before adding relationships
            foreach (Entity entity in entitySet.Entities.OrderBy(e => e.Name))
            {
                foreach (var rel in entity.References.OrderBy(r => r.End1Name))
                {
                    controller.AddRelationship(rel);
                }
            }

            // Add all inheritance relationships
            foreach (var entity in entitySet.Entities.OrderBy(e => e.Name))
            {
                if (entity.Parent != null)
                {
                    controller.AddParentChildRelationship(entity.Parent, entity);
                }
            }
        }
示例#2
0
 protected virtual void OnChildAdded(Entity child, Entity newParent)
 {
     schemaController.AddParentChildRelationship(child, newParent);
 }