<PackageReference Include="System.ClientModel" Version="1.6.1" />

ModelReaderWriterTypeBuilder

public abstract class ModelReaderWriterTypeBuilder
Provides an interface to create objects without needing reflection.
protected abstract Type BuilderType { get; }

Gets the type this builder creates.

protected virtual Type ItemType { get; }

If this builder is a collection, gets the type of the items in the collection.

protected virtual void AddItem(object collectionBuilder, object item)

Adds an item to the passed in collection builder.

protected virtual void AddItemWithKey(object collectionBuilder, string key, object item)

Adds an item to the passed in collection builder under the specified key.

protected virtual object ConvertCollectionBuilder(object collectionBuilder)

Converts the passed in builder collection into the requested collection type.

protected abstract object CreateInstance()

Creates and returns a new instance of the object type that this builder represents.

protected virtual IEnumerable GetItems(object collection)

Gets an IEnumerable representation of the passed in collection.