ModelReaderWriterTypeBuilder 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.
Provides an interface to create objects without needing reflection.
public abstract class ModelReaderWriterTypeBuilder
type ModelReaderWriterTypeBuilder = class
Public MustInherit Class ModelReaderWriterTypeBuilder
- Inheritance
-
ModelReaderWriterTypeBuilder
Remarks
In most cases the implementation will be created automatically by the source generator. In some advanced scenarios the implementation may be created manually by the user see https://aka.ms/no-modelreaderwritertypebuilder-found for more details.
This class has no state and therefore the same instance can be used in multiple calls to ModelReaderWriter. ModelReaderWriterContext will cache the ModelReaderWriterTypeBuilder instances for each type. The state for collection building is maintained internally by ModelReaderWriter and is not needed to be maintained by the implementation. The instance of the collection builder will be passed into each method that needs to modify that state such as AddItem(Object, Object) and AddItemWithKey(Object, String, Object).
Constructors
ModelReaderWriterTypeBuilder() |
Properties
BuilderType |
Gets the type this builder creates. |
ItemType |
If this builder is a collection, gets the type of the items in the collection. |
Methods
AddItem(Object, Object) |
Adds an item to the passed in collection builder. |
AddItemWithKey(Object, String, Object) |
Adds an item to the passed in collection builder under the specified key. |
ConvertCollectionBuilder(Object) |
Converts the passed in builder collection into the requested collection type. |
CreateInstance() |
Creates and returns a new instance of the object type that this builder represents. |
GetItems(Object) |
Gets an IEnumerable representation of the passed in collection. |