Class AvroValueContainer<TKey>
- Namespace
- MASES.EntityFrameworkCore.KNet.Serialization.Avro.Storage
- Assembly
- MASES.EntityFrameworkCore.KNet.Serialization.Avro.dll
The default ValueContainer used from KEFCore
public class AvroValueContainer<TKey> : AvroValueContainer, ISpecificRecord, IValueContainer<TKey> where TKey : notnull
Type Parameters
TKeyIt is the key Type passed from Entity Framework associated to the Entity data will be stored in the AvroValueContainer<TKey>
- Inheritance
-
AvroValueContainer<TKey>
- Implements
-
ISpecificRecordIValueContainer<TKey>
- Inherited Members
Constructors
AvroValueContainer()
Initialize a new instance of AvroValueContainer<TKey>
public AvroValueContainer()
Remarks
It is mainly used from the JSON serializer
AvroValueContainer(IValueContainerData, IComplexTypeConverterFactory?)
Initialize a new instance of AvroValueContainer<TKey>
public AvroValueContainer(IValueContainerData valueContainerData, IComplexTypeConverterFactory? complexTypeFactory = null)
Parameters
valueContainerDataIValueContainerDataThe IValueContainerData containing the information to prepare an instance of AvroValueContainer<TKey>
complexTypeFactoryIComplexTypeConverterFactoryThe instance of IComplexTypeConverterFactory will manage strong type conversion
Remarks
This constructor is mandatory and it is used from KEFCore to request a AvroValueContainer<TKey>
Methods
GetComplexProperties(IEntityType?, IComplexTypeConverterFactory?)
Returns back a dictionary of complex properties (PropertyName, Value) associated to the Entity
public IDictionary<string, object?> GetComplexProperties(IEntityType? entityType, IComplexTypeConverterFactory? complexTypeFactory)
Parameters
entityTypeIEntityTypeThe IEntityType can be used to retrieve metadata, if null shall be done an inference from stored data
complexTypeFactoryIComplexTypeConverterFactoryThe optional IComplexTypeConverterFactory instance to manage conversion of IComplexType
Returns
- IDictionary<string, object>
A dictionary of properties (PropertyName, Value) filled in with the data stored in the IValueContainer<T> instance
GetData(IValueContainerMetadata, ref object[], IComplexTypeConverterFactory?)
Returns back the raw data associated to the Entity contained in IValueContainer<T> instance
public void GetData(IValueContainerMetadata metadata, ref object[] allPropertyValues, IComplexTypeConverterFactory? complexTypeFactory)
Parameters
metadataIValueContainerMetadataThe requesting IValueContainerMetadata to get the data back, can null if not available
allPropertyValuesobject[]The array of object to be filled in with the data stored in the IValueContainer<T> instance for
metadatacomplexTypeFactoryIComplexTypeConverterFactoryThe optional IComplexTypeConverterFactory instance to manage conversion of IComplexType
GetProperties(IEntityType?)
Returns back a dictionary of properties (PropertyName, Value) associated to the Entity
public IDictionary<string, object?> GetProperties(IEntityType? entityType)
Parameters
entityTypeIEntityTypeThe IEntityType can be used to retrieve metadata, if null shall be done an inference from stored data
Returns
- IDictionary<string, object>
A dictionary of properties (PropertyName, Value) filled in with the data stored in the IValueContainer<T> instance