Beispiel #1
0
 public XRoot(EntityContainer root)
 {
     _xDocument  = new XDocument(root.Untyped);
     _rootObject = root;
 }
 public XRootNamespace(EntityContainer root)
 {
     _xDocument = new XDocument(root.Untyped);
       _rootObject = root;
 }
        private EntityContainer.AssociationSetLocalType.EndLocalType CreateStorageAssociationSetEnd(IEntity entity, string role, EntityContainer.AssociationSetLocalType set, EntityContainer.AssociationSetLocalType.EndLocalType otherEnd = null)
        {
            var end = otherEnd == null ?
                set.Ends.Where(e => e.Role.Equals(role) || e.Role.Equals(ResolveStorageEntityName(entity.EntityKeyName))).FirstOrDefault() :
                set.Ends.Where(e => !e.Equals(otherEnd)).FirstOrDefault();

            if (end == null) {
                end = new EntityContainer.AssociationSetLocalType.EndLocalType() {
                    Role = role
                };
                set.Ends.Add(end);
            }

            end.Role = role;
            end.EntitySet = entity.EntityKeyName;

            return end;
        }