public static void MapApiRelationshipsToClrResource(this IResourceType resourceType, object clrResource, IGetRelationships apiGetRelationships)
        {
            Contract.Requires(resourceType != null);
            Contract.Requires(clrResource != null);
            Contract.Requires(apiGetRelationships != null);

            var apiRelationships = apiGetRelationships.Relationships;

            resourceType.SetClrRelationships(clrResource, apiRelationships);
        }
        public static void MapDomResourceToClrRelationships(this IResourceType resourceType, object clrResource, DomReadWriteResource domResource)
        {
            Contract.Requires(resourceType != null);
            Contract.Requires(clrResource != null);
            Contract.Requires(domResource != null);

            var domRelationshipsNode = domResource.GetNode(DomNodeType.Relationships);

            if (domRelationshipsNode == null)
            {
                return;
            }

            var domRelationships = (IDomRelationships)domRelationshipsNode;
            var clrRelationships = domRelationships.Relationships;

            resourceType.SetClrRelationships(clrResource, clrRelationships);
        }