private static void MapDomResourceToApiRelationships(ISetRelationships apiSetRelationships, DomReadWriteResource domResource) { Contract.Requires(apiSetRelationships != null); Contract.Requires(domResource != null); var apiRelationships = GetApiResourceRelationships(domResource); apiSetRelationships.Relationships = apiRelationships; }
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; }