Example #1
0
        private static void ParseDocumentJsonApi(DomDocument domDocument, Document apiDocument)
        {
            Contract.Requires(domDocument != null);
            Contract.Requires(apiDocument != null);

            if (apiDocument.HasJsonApi() == false)
            {
                return;
            }

            domDocument.CreateAndAddNode(() => DomReadOnlyJsonApiVersion.Create(apiDocument));
        }
Example #2
0
        internal DomReadOnlyJsonApiVersion SetDomReadOnlyJsonApiVersion(JsonApiVersion jsonApiVersion)
        {
            Contract.Requires(jsonApiVersion != null);

            // Validation
            this.ValidateJsonApiVersionDoesNotExist();

            // Add the one allowed DOM jsonapi version node to the DOM document node.
            var domReadOnlyJsonApiVersion = this.CreateAndAddNode(() => DomReadOnlyJsonApiVersion.Create(jsonApiVersion));

            return(domReadOnlyJsonApiVersion);
        }