Source/NFX/Serialization/BSON/BSONSerializer.cs
/// <summary>
/// Serializes an instance directly into BSONDocument
/// </summary>
Serializes an instance directly into BSONDocument
Serializes an instance directly into BSONDocument
public BSONDocument Serialize(IBSONSerializable payload, IBSONSerializable parent = null)
    {
      if (payload==null) return null;
      object ctx = null;
      var result = new BSONDocument();
      try
      {
        payload.SerializeToBSON(this, result, parent, ref ctx);
      }
      catch(Exception error)
      {
        throw new BSONException(StringConsts.BSON_SERIALIZER_STB_ERROR.Args(error.ToMessageWithType()), error);
      }
      return result;
    }
public BSONDocument Serialize ( IBSONSerializable payload , IBSONSerializable parent = null ) { if ( payload == null ) return null ; object ctx = null ; var result = new BSONDocument ( ) ; try { payload . SerializeToBSON ( this , result , parent , ref ctx ) ; } catch ( Exception error ) { throw new BSONException ( StringConsts . BSON_SERIALIZER_STB_ERROR . Args ( error . ToMessageWithType ( ) ) , error ) ; } return result ; }
Serializes an instance directly into BSONDocument
Serializes an instance directly into BSONDocument
payload
IBSONSerializable
parent
IBSONSerializable