コード例 #1
0
        private static void MapDomResourceToApiLinks(ISetLinks apiSetLinks, DomReadWriteResource domResource)
        {
            Contract.Requires(apiSetLinks != null);
            Contract.Requires(domResource != null);

            var apiLinks = GetApiResourceLinks(domResource);

            apiSetLinks.Links = apiLinks;
        }
コード例 #2
0
        protected static void ReadLinks(JToken jParentToken, JsonSerializer serializer, ISetLinks setLinks)
        {
            Contract.Requires(jParentToken != null);
            Contract.Requires(serializer != null);
            Contract.Requires(setLinks != null);

            var linksJToken = jParentToken.SelectToken(Keywords.Links);

            if (linksJToken == null)
            {
                return;
            }

            var links = linksJToken.ToObject <Links>(serializer);

            setLinks.Links = links;
        }