public void VisitResourceNavigationRefProperty(ResourceInstanceNavProperty navProperty, ResourceBodyTree treeNode, XmlElement parentNode)
 {
     string type = "";
     string hrefKey = null;
     XmlElement inlineElement = null;
     if (treeNode is AssociationResourceInstance)
     {
         AssociationResourceInstance instance = treeNode as AssociationResourceInstance;
         hrefKey = CreateCanonicalUri(instance.ResourceInstanceKey).Replace(Workspace.ServiceUri + @"\", "");
     }
     else
     {
         inlineElement = CreateDataWebMetadataElement("inline");
         if (navProperty is ResourceInstanceNavColProperty)
         {
             XmlElement feedNode = CreateAtomElement("feed");
             this.Visit(navProperty, treeNode, feedNode);
             inlineElement.AppendChild(feedNode);
             type = "feed";
         }
         else
         {
             this.Visit(navProperty, treeNode, inlineElement);
             type = "entry";
         }
     }
     XmlElement linkElement = CreateAtomLinkElement(navProperty, parentNode, hrefKey);
     XmlAttribute typeAttribute = CreateAtomAttribute("type");
     typeAttribute.Value = "application/atom+xml;type=" + type;
     linkElement.Attributes.Append(typeAttribute);
     if (inlineElement != null)
         linkElement.AppendChild(inlineElement);
     parentNode.AppendChild(linkElement);
 }
Example #2
0
        public AstoriaRequest CreateRequest(ExpNode query, ResourceBodyTree updateTree, RequestVerb operation)
        {
            AstoriaRequest request = new AstoriaRequest(this);
            request.Verb = operation;
            request.Query = query as QueryNode;
            request.UpdateTree = updateTree;

            PrepareRequest(request);

            return request;
        }
Example #3
0
 /// <summary>Checks whether the specified <paramref name="node"/> contains any syntax errors.</summary>
 /// <param name="node">Update node to check.</param>
 /// <returns>
 /// true if there are any errors in the <paramref name="node"/> tree;
 /// false otherwise.
 /// </returns>
 public static bool ContainsSyntaxError(ResourceBodyTree node)
 {
     return InternalContainsSyntaxError(node);
 }