public void DeserializeFromBSON(BSONSerializer serializer, BSONDocument doc, ref object context) { Guid = doc.TryGetObjectValueOf(serializer.PKFieldName).AsGUID(Guid.Empty); True = doc.TryGetObjectValueOf(BSON_FLD_TRUE).AsBool(); False = doc.TryGetObjectValueOf(BSON_FLD_FALSE).AsBool(); CharMin = doc.TryGetObjectValueOf(BSON_FLD_CHARMIN).AsChar(); CharMax = doc.TryGetObjectValueOf(BSON_FLD_CHARMAX).AsChar(); SByteMin = doc.TryGetObjectValueOf(BSON_FLD_SBYTEMIN).AsSByte(); SByteMax = doc.TryGetObjectValueOf(BSON_FLD_SBYTEMAX).AsSByte(); ByteMin = doc.TryGetObjectValueOf(BSON_FLD_BYTEMIN).AsByte(); ByteMax = doc.TryGetObjectValueOf(BSON_FLD_BYTEMAX).AsByte(); Int16Min = doc.TryGetObjectValueOf(BSON_FLD_INT16MIN).AsShort(); Int16Max = doc.TryGetObjectValueOf(BSON_FLD_INT16MAX).AsShort(); UInt16Min = doc.TryGetObjectValueOf(BSON_FLD_UINT16MIN).AsUShort(); UInt16Max = doc.TryGetObjectValueOf(BSON_FLD_UINT16MAX).AsUShort(); Int32Min = doc.TryGetObjectValueOf(BSON_FLD_INT32MIN).AsInt(); Int32Max = doc.TryGetObjectValueOf(BSON_FLD_INT32MAX).AsInt(); UInt32Min = doc.TryGetObjectValueOf(BSON_FLD_UINT32MIN).AsUInt(); UInt32Max = doc.TryGetObjectValueOf(BSON_FLD_UINT32MAX).AsUInt(); Int64Min = doc.TryGetObjectValueOf(BSON_FLD_INT64MIN).AsLong(); Int64Max = doc.TryGetObjectValueOf(BSON_FLD_INT64MAX).AsLong(); UInt64Min = doc.TryGetObjectValueOf(BSON_FLD_UINT64MIN).AsULong(); UInt64Max = doc.TryGetObjectValueOf(BSON_FLD_UINT64MAX).AsULong(); SingleEps = doc.TryGetObjectValueOf(BSON_FLD_SINGLEEPS).AsFloat(); SingleMin = doc.TryGetObjectValueOf(BSON_FLD_SINGLEMIN).AsFloat(); SingleMax = doc.TryGetObjectValueOf(BSON_FLD_SINGLEMAX).AsFloat(); SingleNaN = doc.TryGetObjectValueOf(BSON_FLD_SINGLENAN).AsFloat(); SinglePosInf = doc.TryGetObjectValueOf(BSON_FLD_SINGLEPOSINF).AsFloat(); SingleNegInf = doc.TryGetObjectValueOf(BSON_FLD_SINGLENEGINF).AsFloat(); DoubleEps = doc.TryGetObjectValueOf(BSON_FLD_DOUBLEEPS).AsDouble(); DoubleMin = doc.TryGetObjectValueOf(BSON_FLD_DOUBLEMIN).AsDouble(); DoubleMax = doc.TryGetObjectValueOf(BSON_FLD_DOUBLEMAX).AsDouble(); DoubleNaN = doc.TryGetObjectValueOf(BSON_FLD_DOUBLENAN).AsDouble(); DoublePosInf = doc.TryGetObjectValueOf(BSON_FLD_DOUBLEPOSINF).AsDouble(); DoubleNegInf = doc.TryGetObjectValueOf(BSON_FLD_DOUBLENEGINF).AsDouble(); DecimalMin = DataDocConverter.Decimal_BSONtoCLR(doc[BSON_FLD_DECIMALMIN]); DecimalMax = DataDocConverter.Decimal_BSONtoCLR(doc[BSON_FLD_DECIMALMAX]); DecimalZero = DataDocConverter.Decimal_BSONtoCLR(doc[BSON_FLD_DECIMALZERO]); DecimalOne = DataDocConverter.Decimal_BSONtoCLR(doc[BSON_FLD_DECIMALONE]); DecimalMOne = DataDocConverter.Decimal_BSONtoCLR(doc[BSON_FLD_DECIMALMONE]); DateTimeMin = doc.TryGetObjectValueOf(BSON_FLD_DATETIMEMIN).AsDateTime(); DateTimeMax = doc.TryGetObjectValueOf(BSON_FLD_DATETIMEMAX).AsDateTime(); DateTimeNow = doc.TryGetObjectValueOf(BSON_FLD_DATETIMENOW).AsDateTime(); DateTimeUtc = doc.TryGetObjectValueOf(BSON_FLD_DATETIMEUTC).AsDateTime(); TimeSpanMin = doc.TryGetObjectValueOf(BSON_FLD_TIMESPANMIN).AsTimeSpan(); TimeSpanMax = doc.TryGetObjectValueOf(BSON_FLD_TIMESPANMAX).AsTimeSpan(); StringEmpty = doc.TryGetObjectValueOf(BSON_FLD_STRINGEMPTY).AsString(); StringNull = doc.TryGetObjectValueOf(BSON_FLD_STRINGNULL).AsString(); String = doc.TryGetObjectValueOf(BSON_FLD_STRING).AsString(); }
public override void DeserializeFromBSON(BSONSerializer serializer, BSONDocument doc, ref object context) { base.DeserializeFromBSON(serializer, doc, ref context); m_Value = DataDocConverter.Decimal_BSONtoCLR(doc[BSON_FLD_VALUE]); }