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>>IMessageIEquatable<ProtobufValueContainer<TKey>>IDeepCloneable<ProtobufValueContainer<TKey>>IValueContainer<TKey>
- Inherited Members
Constructors
ProtobufValueContainer()
Initialize a new instance of ProtobufValueContainer<TKey>
public ProtobufValueContainer()
Remarks
It is mainly used from the JSON serializer
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
ProtobufValueContainer(IEntityType, object[])
Initialize a new instance of ProtobufValueContainer<TKey>
public ProtobufValueContainer(IEntityType tName, object[] rData)
Parameters
tName
IEntityTypeThe IEntityType requesting the ProtobufValueContainer<TKey> for
rData
rData
object[]The data, built from EFCore, to be stored in the ProtobufValueContainer<TKey>
Remarks
This constructor is mandatory and it is used from KEFCore to request a ProtobufValueContainer<TKey>
Properties
ClrType
The CLR Type of IEntityType
public string ClrType { get; }
Property Value
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
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
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetData(IEntityType, ref object[])
Returns back the raw data associated to the Entity
public void GetData(IEntityType tName, ref object[] array)
Parameters
tName
IEntityTypeThe requesting IEntityType to get the data back, can null if not available
array
object[]The array of object to be filled in with the data stored in the ValueContainer
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetProperties()
Returns back a dictionary of properties (PropertyIndex, PropertyName) associated to the Entity
public IReadOnlyDictionary<int, string> GetProperties()
Returns
- IReadOnlyDictionary<int, string>
A dictionary of properties (PropertyIndex, PropertyName) filled in with the data stored in the ValueContainer
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
CodedOutputStreamCoded output stream to write the data to. Must not be null.