public static void MapApiIdToClrResource(this IResourceType resourceType, object clrResource, IGetResourceIdentity apiGetResourceIdentity)
        {
            Contract.Requires(resourceType != null);
            Contract.Requires(clrResource != null);
            Contract.Requires(apiGetResourceIdentity != null);

            var apiId = apiGetResourceIdentity.Id;
            var clrId = resourceType.ToClrId(apiId);

            resourceType.SetClrId(clrResource, clrId);
        }
        public static void MapDomResourceToClrId(this IResourceType resourceType, object clrResource, DomReadWriteResource domResource)
        {
            Contract.Requires(resourceType != null);
            Contract.Requires(clrResource != null);
            Contract.Requires(domResource != null);

            var domIdNode = domResource.GetNode <DomNodeType, DomId>(DomNodeType.Id);

            if (domIdNode == null)
            {
                return;
            }

            var clrId = domIdNode.ClrId;

            resourceType.SetClrId(clrResource, clrId);
        }