Class BSONParentKnownTypes
Provides a scope of fake BSONWritable parent which indicates what types are known this way the serilizer does not have to emit the TypeIDFieldName element. Used with root serializations i.e. to database, when storing log messages in the table, it is not necessary to store Log.Message type ID in every record. Pass the instance to serializer.Serialize(parent: instance). Pre-allocate known types before calling serializer.Deserialize(result: instance)
Inheritance
System.Object
    BSONParentKnownTypes
  Implements
Inherited Members
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
    
      System.Object.ToString()
    
  Namespace: NFX.Serialization.BSON
Assembly: NFX.dll
Syntax
public sealed class BSONParentKnownTypes : IBSONSerializable
  Constructors
BSONParentKnownTypes(Type[])
Specifies the types which are known to the parent calling scope, consequently the TypeIDFieldNamewill not be emitted to doc. Use in cases like writing to database table, where all root types are known by design
Declaration
public BSONParentKnownTypes(params Type[] known)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type[] | known | 
Fields
KnownTypes
Declaration
public readonly IEnumerable<Type> KnownTypes
  Field Value
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<System.Type> | 
Methods
IsKnownTypeForBSONDeserialization(Type)
Declaration
public bool IsKnownTypeForBSONDeserialization(Type type)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | type | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
SerializeToBSON(BSONSerializer, BSONDocument, IBSONSerializable, ref Object)
Declaration
public void SerializeToBSON(BSONSerializer serializer, BSONDocument doc, IBSONSerializable parent, ref object context)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BSONSerializer | serializer | |
| BSONDocument | doc | |
| IBSONSerializable | parent | |
| System.Object | context |