SequoiaDB
 All Classes Namespaces Files Functions Variables Enumerations Properties Pages
Classes | Static Public Member Functions | List of all members
SequoiaDB.Bson.BsonTypeMapper Class Reference

A static class that maps between .NET objects and BsonValues. More...

Static Public Member Functions

static BsonValue MapToBsonValue (object value)
 Maps an object to an instance of the closest BsonValue class.
 
static BsonValue MapToBsonValue (object value, BsonType bsonType)
 Maps an object to a specific BsonValue type.
 
static object MapToDotNetValue (BsonValue bsonValue)
 Maps a BsonValue to a .NET value using the default BsonTypeMapperOptions.
 
static object MapToDotNetValue (BsonValue bsonValue, BsonTypeMapperOptions options)
 Maps a BsonValue to a .NET value.
 
static void RegisterCustomTypeMapper (Type type, ICustomBsonTypeMapper customTypeMapper)
 Registers a custom type mapper.
 
static bool TryMapToBsonValue (object value, out BsonValue bsonValue)
 Tries to map an object to an instance of the closest BsonValue class.
 

Detailed Description

A static class that maps between .NET objects and BsonValues.

Member Function Documentation

static BsonValue SequoiaDB.Bson.BsonTypeMapper.MapToBsonValue ( object  value)
inlinestatic

Maps an object to an instance of the closest BsonValue class.

Parameters
valueAn object.
Returns
A BsonValue.
static BsonValue SequoiaDB.Bson.BsonTypeMapper.MapToBsonValue ( object  value,
BsonType  bsonType 
)
inlinestatic

Maps an object to a specific BsonValue type.

Parameters
valueAn object.
bsonTypeThe BsonType to map to.
Returns
A BsonValue of the desired type (or BsonNull.Value if value is null and bsonType is Null).
static object SequoiaDB.Bson.BsonTypeMapper.MapToDotNetValue ( BsonValue  bsonValue)
inlinestatic

Maps a BsonValue to a .NET value using the default BsonTypeMapperOptions.

Parameters
bsonValueThe BsonValue.
Returns
The mapped .NET value.
static object SequoiaDB.Bson.BsonTypeMapper.MapToDotNetValue ( BsonValue  bsonValue,
BsonTypeMapperOptions  options 
)
inlinestatic

Maps a BsonValue to a .NET value.

Parameters
bsonValueThe BsonValue.
optionsThe BsonTypeMapperOptions.
Returns
The mapped .NET value.
static void SequoiaDB.Bson.BsonTypeMapper.RegisterCustomTypeMapper ( Type  type,
ICustomBsonTypeMapper  customTypeMapper 
)
inlinestatic

Registers a custom type mapper.

Parameters
typeThe type.
customTypeMapperA custom type mapper.
static bool SequoiaDB.Bson.BsonTypeMapper.TryMapToBsonValue ( object  value,
out BsonValue  bsonValue 
)
inlinestatic

Tries to map an object to an instance of the closest BsonValue class.

Parameters
valueAn object.
bsonValueThe BsonValue.
Returns
True if the mapping was successfull.

The documentation for this class was generated from the following file: