Table of Contents

Class ProtobufValueContainer<TKey>

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

The default ValueContainer used from KEFCore

public class ProtobufValueContainer<TKey> : IMessage<ProtobufValueContainer<TKey>>, IMessage, IEquatable<ProtobufValueContainer<TKey>>, IDeepCloneable<ProtobufValueContainer<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 ProtobufValueContainer<TKey>

Inheritance
ProtobufValueContainer<TKey>
Implements
IMessage<ProtobufValueContainer<TKey>>
IMessage
IDeepCloneable<ProtobufValueContainer<TKey>>
Inherited Members

Constructors

ProtobufValueContainer()

Initialize a new instance of ProtobufValueContainer<TKey>

public ProtobufValueContainer()

Remarks

It is mainly used from the JSON serializer

ProtobufValueContainer(IValueContainerData, IComplexTypeConverterFactory?)

Initialize a new instance of ProtobufValueContainer<TKey>

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

Parameters

valueContainerData IValueContainerData

The IValueContainerData containing the information to prepare an instance of ProtobufValueContainer<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 ProtobufValueContainer<TKey>

ProtobufValueContainer(ProtobufValueContainer<TKey>)

Initialize a new instance of ProtobufValueContainer<TKey>

public ProtobufValueContainer(ProtobufValueContainer<TKey> clone)

Parameters

clone ProtobufValueContainer<TKey>

Remarks

It is mainly used from the JSON serializer

ProtobufValueContainer(ValueContainer)

Initialize a new instance of ProtobufValueContainer<TKey>

public ProtobufValueContainer(ValueContainer clone)

Parameters

clone ValueContainer

Remarks

It is mainly used from the JSON serializer

Properties

ClrType

The CLR Type of IEntityType

public string ClrType { get; }

Property Value

string

Descriptor

Descriptor for this message. All instances are expected to return the same descriptor, and for generated types this will be an explicitly-implemented member, returning the same value as the static property declared on the type.

public MessageDescriptor Descriptor { get; }

Property Value

MessageDescriptor

EntityName

The Entity name of IEntityType

public string EntityName { get; }

Property Value

string

Methods

CalculateSize()

Calculates the size of this message in Protocol Buffer wire format, in bytes.

public int CalculateSize()

Returns

int

The number of bytes required to write this message to a coded output stream.

Clone()

Creates a deep clone of this object.

public ProtobufValueContainer<TKey> Clone()

Returns

ProtobufValueContainer<TKey>

A deep clone of this object.

Equals(ProtobufValueContainer<TKey>?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ProtobufValueContainer<TKey>? other)

Parameters

other ProtobufValueContainer<TKey>

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

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

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

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

MergeFrom(CodedInputStream)

Merges the data from the specified coded input stream with the current message.

public void MergeFrom(CodedInputStream input)

Parameters

input CodedInputStream

Remarks

See the user guide for precise merge semantics.

MergeFrom(ProtobufValueContainer<TKey>)

Merges the given message into this one.

public void MergeFrom(ProtobufValueContainer<TKey> message)

Parameters

message ProtobufValueContainer<TKey>

The message to merge with this one. Must not be null.

Remarks

See the user guide for precise merge semantics.

WriteTo(CodedOutputStream)

Writes the data to the given coded output stream.

public void WriteTo(CodedOutputStream output)

Parameters

output CodedOutputStream

Coded output stream to write the data to. Must not be null.