Esempio n. 1
0
 public static ResourceInstanceProperty CreateCollectionInstanceProperty(KeyExpressions keyExps, ResourceContainer container, ResourceProperty navProperty)
 {
     ResourceType navResourceType = (navProperty.Type as CollectionType).SubType as ResourceType;
     List<AssociationResourceInstance> associationNodes = new List<AssociationResourceInstance>();
     foreach (KeyExpression associatedKey in keyExps)
     {
         ResourceInstanceKey resourceInstanceKey = ResourceInstanceKey.ConstructResourceInstanceKey(associatedKey);
         associationNodes.Add(new AssociationResourceInstance(resourceInstanceKey, AssociationOperation.Add));
     }
     if (associationNodes.Count > 0)
     {
         ResourceInstanceNavColProperty navigationProperty = new ResourceInstanceNavColProperty(navProperty.Name, associationNodes.ToArray());
         return navigationProperty;
     }
     return null;
 }
 public void VisitResourceNavigationCollectionProperty(ResourceInstanceNavColProperty navColProperty, XmlElement parentNode)
 {
     foreach (ResourceBodyTree node in navColProperty.Collection.NodeList)
     {
         VisitResourceNavigationRefProperty(navColProperty, node, parentNode);
     }
 }