AllowedTypesSerializationBinder Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An implementation of the Newtonsoft.Json.Serialization.DefaultSerializationBinder, capable of allowing only desired Types to be serialized and deserialized.
public class AllowedTypesSerializationBinder : Newtonsoft.Json.Serialization.DefaultSerializationBinder
type AllowedTypesSerializationBinder = class
inherit DefaultSerializationBinder
Public Class AllowedTypesSerializationBinder
Inherits DefaultSerializationBinder
- Inheritance
-
Newtonsoft.Json.Serialization.DefaultSerializationBinderAllowedTypesSerializationBinder
Constructors
AllowedTypesSerializationBinder(IList<Type>) |
Initializes a new instance of the AllowedTypesSerializationBinder class. |
Properties
AllowedTypes |
Gets the collection of the allowed types. |
Methods
BindToName(Type, String, String) |
Given the
Either allowed or not allowed, it will output the name of the Type through the When allowed, it will add the Type to the AllowedTypes collection. |
BindToType(String, String) |
Given the When found, it will add the Type to the AllowedTypes collection if it doesn't exist. |
Verify() |
Verifies if there are types that are not allowed. When not allowed, it will throw an InvalidOperationException. |