Ejemplo n.º 1
0
        private void ResolveContentTypes(JContainer container)
        {
            if (ContentTypeResolver == null || container["$type"] != null)
            {
                return;
            }

            var contentType = container["sys"]?["contentType"]?["sys"]?["id"]?.ToString();

            if (contentType == null)
            {
                return;
            }

            var type = ContentTypeResolver.Resolve(contentType);

            if (type != null)
            {
                container.AddFirst(new JProperty("$type", type.AssemblyQualifiedName));
            }
        }