YamlTypeClassifierFactory Class
Creates the YamlTypeClassifier used to select a union case from a YAML payload.
public abstract class YamlTypeClassifierFactoryRemarks
Register a factory through YamlSerializerOptions.TypeClassifiers. Without one, union cases are selected by YAML shape alone and a payload matching several cases fails to deserialize.
Constructors
| Name | Description |
|---|---|
| YamlTypeClassifierFactory() |
YamlTypeClassifierFactory()
protected YamlTypeClassifierFactory()No documentation is available.
Methods
| Name | Description |
|---|---|
| CanClassify(YamlTypeClassifierContext) | Determines whether this factory can classify the type described by context. |
| CreateYamlClassifier(YamlTypeClassifierContext, YamlSerializerOptions) | Creates the classifier for the type described by context. |
CanClassify(YamlTypeClassifierContext)
Determines whether this factory can classify the type described by context.
public abstract bool CanClassify(YamlTypeClassifierContext context)Parameters
contextYamlTypeClassifierContext- The type being classified.
Returns
bool true when the factory can classify the type; otherwise false.
CreateYamlClassifier(YamlTypeClassifierContext, YamlSerializerOptions)
Creates the classifier for the type described by context.
public abstract YamlTypeClassifier CreateYamlClassifier(YamlTypeClassifierContext context, YamlSerializerOptions options)Parameters
contextYamlTypeClassifierContext- The type being classified.
optionsYamlSerializerOptions- The options the classifier is created for.
Returns
YamlTypeClassifier The classifier to select a case with.