Table of Contents

Class DefaultValueContainer<TKey>

Namespace
MASES.EntityFrameworkCore.KNet.Serialization.Json.Storage
Assembly
MASES.EntityFrameworkCore.KNet.Serialization.dll

The default ValueContainer used from KEFCore

public class DefaultValueContainer<TKey> : IValueContainer<TKey> where TKey : notnull

Type Parameters

TKey

It is the key Type passed from Entity Framework associated to the Entity data will be stored in the DefaultValueContainer<TKey>

Inheritance
DefaultValueContainer<TKey>
Implements
Inherited Members

Constructors

DefaultValueContainer()

Initialize a new instance of DefaultValueContainer<TKey>

public DefaultValueContainer()

Remarks

It is mainly used from the JSON serializer

DefaultValueContainer(IValueContainerData, IComplexTypeConverterFactory?)

Initialize a new instance of DefaultValueContainer<TKey>

public DefaultValueContainer(IValueContainerData valueContainerData, IComplexTypeConverterFactory? complexTypeFactory = null)

Parameters

valueContainerData IValueContainerData

The IValueContainerData containing the information to prepare an instance of DefaultValueContainer<TKey>

complexTypeFactory IComplexTypeConverterFactory

The instance of IComplexTypeConverterFactory will manage strong type conversion

Remarks

This constructor is mandatory and it is used from KEFCore to request a DefaultValueContainer<TKey>

Properties

ClrType

The CLR Type of IEntityType

public string ClrType { get; set; }

Property Value

string

Data

The data stored associated to the IEntityType

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<int, PropertyData>? Data { get; set; }

Property Value

Dictionary<int, PropertyData>

EntityName

The Entity name of IEntityType

public string EntityName { get; set; }

Property Value

string

Properties

The data stored associated to the IProperty and IComplexProperty of IEntityType

public PropertyData[]? Properties { get; set; }

Property Value

PropertyData[]

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

entityType IEntityType

The IEntityType can be used to retrieve metadata, if null shall be done an inference from stored data

complexTypeFactory IComplexTypeConverterFactory

The 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 = null)

Parameters

metadata IValueContainerMetadata

The requesting IValueContainerMetadata to get the data back, can null if not available

allPropertyValues object[]

The array of object to be filled in with the data stored in the IValueContainer<T> instance for metadata

complexTypeFactory IComplexTypeConverterFactory

The 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

entityType IEntityType

The 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