/// <summary>
        /// Adds the specified resolver.
        /// </summary>
        /// <param name="resolver">The resolver.</param>
        public void Add(GenericDataContractResolver resolver)
        {
            if (resolver == null || resolver.KnownTypes.Count < 1)
            {
                return;
            }

            this.AddKnownTypeRange(resolver.KnownTypes);
        }
        public static void AddGenericDataContractResolver(this DataContractSerializerOperationBehavior source, params Type[] knownTypes)
        {
            GenericDataContractResolver resolver = source.DataContractResolver as GenericDataContractResolver;

            if (resolver != null)
            {
                resolver.AddKnownTypeRange(knownTypes);
                resolver.AddKnownTypeRange(GenericDataContractResolver.GetReflectTypes(Assembly.GetCallingAssembly()));
                resolver.AddKnownTypeRange(GenericDataContractResolver.GetReflectTypes(Assembly.GetEntryAssembly()));
            }
            else
            {
                resolver = new GenericDataContractResolver(knownTypes);
            }

            source.DataContractResolver = resolver;
        }