public static void MapApiLinksToClrResource(this IResourceType resourceType, object clrResource, IGetLinks apiGetLinks)
        {
            Contract.Requires(resourceType != null);
            Contract.Requires(clrResource != null);
            Contract.Requires(apiGetLinks != null);

            var apiLinks = apiGetLinks.Links;

            resourceType.SetClrLinks(clrResource, apiLinks);
        }
        public static void MapDomResourceToClrLinks(this IResourceType resourceType, object clrResource, DomReadWriteResource domResource)
        {
            Contract.Requires(resourceType != null);
            Contract.Requires(clrResource != null);
            Contract.Requires(domResource != null);

            var domLinksNode = domResource.GetNode(DomNodeType.Links);

            if (domLinksNode == null)
            {
                return;
            }

            var domLinks = (IDomLinks)domLinksNode;
            var clrLinks = domLinks.Links;

            resourceType.SetClrLinks(clrResource, clrLinks);
        }