示例#1
0
        private static void MapDomResourceToApiRelationships(ISetRelationships apiSetRelationships, DomReadWriteResource domResource)
        {
            Contract.Requires(apiSetRelationships != null);
            Contract.Requires(domResource != null);

            var apiRelationships = GetApiResourceRelationships(domResource);

            apiSetRelationships.Relationships = apiRelationships;
        }
示例#2
0
        protected static void ReadRelationships(JToken jParentToken, JsonSerializer serializer, ISetRelationships setRelationships)
        {
            Contract.Requires(jParentToken != null);
            Contract.Requires(serializer != null);
            Contract.Requires(setRelationships != null);

            var relationshipsJToken = jParentToken.SelectToken(Keywords.Relationships);

            if (relationshipsJToken == null)
            {
                return;
            }

            var relationships = relationshipsJToken.ToObject <Relationships>(serializer);

            setRelationships.Relationships = relationships;
        }