Table of Contents

Class RepresentationConverter

Namespace
MongoDB.Bson.Serialization.Options
Assembly
MongoDB.Bson.dll

Represents the external representation of a field or property.

public class RepresentationConverter
Inheritance
RepresentationConverter
Inherited Members
Extension Methods

Constructors

RepresentationConverter(bool, bool)

Initializes a new instance of the RepresentationConverter class.

public RepresentationConverter(bool allowOverflow, bool allowTruncation)

Parameters

allowOverflow bool

Whether to allow overflow.

allowTruncation bool

Whether to allow truncation.

Properties

AllowOverflow

Gets whether to allow overflow.

public bool AllowOverflow { get; }

Property Value

bool

AllowTruncation

Gets whether to allow truncation.

public bool AllowTruncation { get; }

Property Value

bool

Methods

ToDecimal(Decimal128)

Converts a Decimal128 to a Decimal.

public decimal ToDecimal(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

decimal

A Decimal.

ToDecimal(double)

Converts a Double to a Decimal.

public decimal ToDecimal(double value)

Parameters

value double

A Double.

Returns

decimal

A Decimal.

ToDecimal(int)

Converts an Int32 to a Decimal.

public decimal ToDecimal(int value)

Parameters

value int

An Int32.

Returns

decimal

A Decimal.

ToDecimal(long)

Converts an Int64 to a Decimal.

public decimal ToDecimal(long value)

Parameters

value long

An Int64.

Returns

decimal

A Decimal.

ToDecimal128(decimal)

Converts a decimal to a Decimal128.

public Decimal128 ToDecimal128(decimal value)

Parameters

value decimal

A decimal.

Returns

Decimal128

A Decimal128.

ToDecimal128(double)

Converts a Double to a Decimal128.

public Decimal128 ToDecimal128(double value)

Parameters

value double

A Double.

Returns

Decimal128

A Decimal128.

ToDecimal128(int)

Converts an Int32 to a Decimal128.

public Decimal128 ToDecimal128(int value)

Parameters

value int

An Int32.

Returns

Decimal128

A Decimal128.

ToDecimal128(long)

Converts an Int64 to a Decimal128.

public Decimal128 ToDecimal128(long value)

Parameters

value long

An Int64.

Returns

Decimal128

A Decimal128.

ToDecimal128(ulong)

Converts a UInt64 to a Decimal128.

[CLSCompliant(false)]
public Decimal128 ToDecimal128(ulong value)

Parameters

value ulong

A UInt64.

Returns

Decimal128

A Decimal128.

ToDouble(Decimal128)

Converts a Decimal128 to a Double.

public double ToDouble(Decimal128 value)

Parameters

value Decimal128

A Decimal.

Returns

double

A Double.

ToDouble(decimal)

Converts a Decimal to a Double.

public double ToDouble(decimal value)

Parameters

value decimal

A Decimal.

Returns

double

A Double.

ToDouble(double)

Converts a Double to a Double.

public double ToDouble(double value)

Parameters

value double

A Double.

Returns

double

A Double.

ToDouble(short)

Converts an Int16 to a Double.

public double ToDouble(short value)

Parameters

value short

An Int16.

Returns

double

A Double.

ToDouble(int)

Converts an Int32 to a Double.

public double ToDouble(int value)

Parameters

value int

An Int32.

Returns

double

A Double.

ToDouble(long)

Converts an Int64 to a Double.

public double ToDouble(long value)

Parameters

value long

An Int64.

Returns

double

A Double.

ToDouble(float)

Converts a Single to a Double.

public double ToDouble(float value)

Parameters

value float

A Single.

Returns

double

A Double.

ToDouble(ushort)

Converts a UInt16 to a Double.

[CLSCompliant(false)]
public double ToDouble(ushort value)

Parameters

value ushort

A UInt16.

Returns

double

A Double.

ToDouble(uint)

Converts a UInt32 to a Double.

[CLSCompliant(false)]
public double ToDouble(uint value)

Parameters

value uint

A UInt32.

Returns

double

A Double.

ToDouble(ulong)

Converts a UInt64 to a Double.

[CLSCompliant(false)]
public double ToDouble(ulong value)

Parameters

value ulong

A UInt64.

Returns

double

A Double.

ToInt16(Decimal128)

Converts a Decimal128 to an Int16.

public short ToInt16(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

short

An Int16.

ToInt16(double)

Converts a Double to an Int16.

public short ToInt16(double value)

Parameters

value double

A Double.

Returns

short

An Int16.

ToInt16(int)

Converts an Int32 to an Int16.

public short ToInt16(int value)

Parameters

value int

An Int32.

Returns

short

An Int16.

ToInt16(long)

Converts an Int64 to an Int16.

public short ToInt16(long value)

Parameters

value long

An Int64.

Returns

short

An Int16.

ToInt32(Decimal128)

Converts a Decimal128 to an Int32.

public int ToInt32(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

int

An Int32.

ToInt32(decimal)

Converts a Decimal to an Int32.

public int ToInt32(decimal value)

Parameters

value decimal

A Decimal.

Returns

int

An Int32.

ToInt32(double)

Converts a Double to an Int32.

public int ToInt32(double value)

Parameters

value double

A Double.

Returns

int

An Int32.

ToInt32(short)

Converts an Int16 to an Int32.

public int ToInt32(short value)

Parameters

value short

An Int16.

Returns

int

An Int32.

ToInt32(int)

Converts an Int32 to an Int32.

public int ToInt32(int value)

Parameters

value int

An Int32.

Returns

int

An Int32.

ToInt32(long)

Converts an Int64 to an Int32.

public int ToInt32(long value)

Parameters

value long

An Int64.

Returns

int

An Int32.

ToInt32(float)

Converts a Single to an Int32.

public int ToInt32(float value)

Parameters

value float

A Single.

Returns

int

An Int32.

ToInt32(ushort)

Converts a UInt16 to an Int32.

[CLSCompliant(false)]
public int ToInt32(ushort value)

Parameters

value ushort

A UInt16.

Returns

int

An Int32.

ToInt32(uint)

Converts a UInt32 to an Int32.

[CLSCompliant(false)]
public int ToInt32(uint value)

Parameters

value uint

A UInt32.

Returns

int

An Int32.

ToInt32(ulong)

Converts a UInt64 to an Int32.

[CLSCompliant(false)]
public int ToInt32(ulong value)

Parameters

value ulong

A UInt64.

Returns

int

An Int32.

ToInt64(Decimal128)

Converts a Decimal128 to an Int64.

public long ToInt64(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

long

An Int64.

ToInt64(decimal)

Converts a Decimal to an Int64.

public long ToInt64(decimal value)

Parameters

value decimal

A Decimal.

Returns

long

An Int64.

ToInt64(double)

Converts a Double to an Int64.

public long ToInt64(double value)

Parameters

value double

A Double.

Returns

long

An Int64.

ToInt64(short)

Converts an Int16 to an Int64.

public long ToInt64(short value)

Parameters

value short

An Int16.

Returns

long

An Int64.

ToInt64(int)

Converts an Int32 to an Int64.

public long ToInt64(int value)

Parameters

value int

An Int32.

Returns

long

An Int64.

ToInt64(long)

Converts an Int64 to an Int64.

public long ToInt64(long value)

Parameters

value long

An Int64.

Returns

long

An Int64.

ToInt64(float)

Converts a Single to an Int64.

public long ToInt64(float value)

Parameters

value float

A Single.

Returns

long

An Int64.

ToInt64(ushort)

Converts a UInt16 to an Int64.

[CLSCompliant(false)]
public long ToInt64(ushort value)

Parameters

value ushort

A UInt16.

Returns

long

An Int64.

ToInt64(uint)

Converts a UInt32 to an Int64.

[CLSCompliant(false)]
public long ToInt64(uint value)

Parameters

value uint

A UInt32.

Returns

long

An Int64.

ToInt64(ulong)

Converts a UInt64 to an Int64.

[CLSCompliant(false)]
public long ToInt64(ulong value)

Parameters

value ulong

A UInt64.

Returns

long

An Int64.

ToSingle(Decimal128)

Converts a Decimal128 to a Single.

public float ToSingle(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

float

A Single.

ToSingle(double)

Converts a Double to a Single.

public float ToSingle(double value)

Parameters

value double

A Double.

Returns

float

A Single.

ToSingle(int)

Converts an Int32 to a Single.

public float ToSingle(int value)

Parameters

value int

An Int32.

Returns

float

A Single.

ToSingle(long)

Converts an Int64 to a Single.

public float ToSingle(long value)

Parameters

value long

An Int64.

Returns

float

A Single.

ToUInt16(Decimal128)

Converts a Decimal128 to a UInt16.

[CLSCompliant(false)]
public ushort ToUInt16(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

ushort

A UInt16.

ToUInt16(double)

Converts a Double to a UInt16.

[CLSCompliant(false)]
public ushort ToUInt16(double value)

Parameters

value double

A Double.

Returns

ushort

A UInt16.

ToUInt16(int)

Converts an Int32 to a UInt16.

[CLSCompliant(false)]
public ushort ToUInt16(int value)

Parameters

value int

An Int32.

Returns

ushort

A UInt16.

ToUInt16(long)

Converts an Int64 to a UInt16.

[CLSCompliant(false)]
public ushort ToUInt16(long value)

Parameters

value long

An Int64.

Returns

ushort

A UInt16.

ToUInt32(Decimal128)

Converts a Decimal128 to a UInt32.

[CLSCompliant(false)]
public uint ToUInt32(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

uint

A UInt32.

ToUInt32(double)

Converts a Double to a UInt32.

[CLSCompliant(false)]
public uint ToUInt32(double value)

Parameters

value double

A Double.

Returns

uint

A UInt32.

ToUInt32(int)

Converts an Int32 to a UInt32.

[CLSCompliant(false)]
public uint ToUInt32(int value)

Parameters

value int

An Int32.

Returns

uint

A UInt32.

ToUInt32(long)

Converts an Int64 to a UInt32.

[CLSCompliant(false)]
public uint ToUInt32(long value)

Parameters

value long

An Int64.

Returns

uint

A UInt32.

ToUInt64(Decimal128)

Converts a Decimal128 to a UInt64.

[CLSCompliant(false)]
public ulong ToUInt64(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

ulong

A UInt64.

ToUInt64(double)

Converts a Double to a UInt64.

[CLSCompliant(false)]
public ulong ToUInt64(double value)

Parameters

value double

A Double.

Returns

ulong

A UInt64.

ToUInt64(int)

Converts an Int32 to a UInt64.

[CLSCompliant(false)]
public ulong ToUInt64(int value)

Parameters

value int

An Int32.

Returns

ulong

A UInt64.

ToUInt64(long)

Converts an Int64 to a UInt64.

[CLSCompliant(false)]
public ulong ToUInt64(long value)

Parameters

value long

An Int64.

Returns

ulong

A UInt64.