YamlMetadataServices
OfficeIMO.Yaml
Creates YamlTypeInfo<T> instances. The source generator calls these methods from the code it emits for a YamlSerializerContext, and reflection-based metadata uses the same methods, so both produce the same YAML.
Inheritance
- object
- YamlMetadataServices
Methods
public static YamlTypeInfo<TCollection> CreateCollectionInfo<TCollection, TElement>(YamlSerializerOptions options, Func<List<TElement?>, TCollection> finish) #Creates metadata for a collection written as a sequence. Items are read into a list, and finish turns the list into the collection.
Type Parameters
- TCollection
- TElement
Parameters
- options OfficeIMO.Yaml.YamlSerializerOptions
- finish System.Func<System.Collections.Generic.List<TElement?>, TCollection>
Returns
YamlTypeInfo<TCollection>public static YamlTypeInfo<TDictionary> CreateDictionaryInfo<TDictionary, TKey, TValue>(YamlSerializerOptions options, Func<Dictionary<TKey, TValue?>, TDictionary> finish) #Creates metadata for a dictionary written as a mapping. Entries are read into a dictionary, and finish turns it into the target type.
Type Parameters
- TDictionary
- TKey
- TValue
Parameters
- options OfficeIMO.Yaml.YamlSerializerOptions
- finish System.Func<System.Collections.Generic.Dictionary<TKey, TValue?>, TDictionary>
Returns
YamlTypeInfo<TDictionary>public static YamlTypeInfo<T> CreateEnumInfo<T>(YamlSerializerOptions options) #Creates metadata for an enum written by member name.
Type Parameters
- T
Parameters
- options OfficeIMO.Yaml.YamlSerializerOptions
Returns
YamlTypeInfo<T>public static YamlTypeInfo<T?> CreateNullableInfo<T>(YamlSerializerOptions options) #Creates metadata for a nullable value type.
Type Parameters
- T
Parameters
- options OfficeIMO.Yaml.YamlSerializerOptions
Returns
YamlTypeInfo<T?>public static YamlTypeInfo<T?> CreateObjectInfo<T>(YamlSerializerOptions options, YamlObjectInfoValues<T?> values) #Creates metadata for an object written as a mapping of its properties.
Type Parameters
- T
Parameters
- options OfficeIMO.Yaml.YamlSerializerOptions
- values OfficeIMO.Yaml.YamlObjectInfoValues<T?>
Returns
YamlTypeInfo<T?>public static YamlPropertyInfo CreatePropertyInfo<T>(YamlSerializerOptions options, YamlPropertyInfoValues<T?> values) #Creates metadata for one property of an object.
Type Parameters
- T
Parameters
- options OfficeIMO.Yaml.YamlSerializerOptions
- values OfficeIMO.Yaml.YamlPropertyInfoValues<T?>
Returns
YamlPropertyInfo