Class DynamoBoolConverter
The DynamoBoolConverter class is used to convert bool
and bool?
value to/from a DynamoDB attribute value.
Implements
Inherited Members
Namespace: LambdaSharp.DynamoDB.Serialization.Converters
Assembly: LambdaSharp.DynamoDB.Serialization.dll
Syntax
public class DynamoBoolConverter : ADynamoAttributeConverter, IDynamoAttributeConverter
Fields
Instance
The Instance class field exposes a reusable instance of the class.
Declaration
public static readonly DynamoBoolConverter Instance
Field Value
Type | Description |
---|---|
DynamoBoolConverter |
Methods
CanConvert(Type)
The CanConvert(Type) method checks if this converter can handle the presented type.
Declaration
public override bool CanConvert(Type typeToConvert)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeToConvert | The type to convert. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
FromBool(Boolean, Type, DynamoSerializerOptions)
The FromBool(Boolean, Type, DynamoSerializerOptions) method converts a DynamoDB BOOL attribute value to the type of the converter.
Declaration
public override object FromBool(bool value, Type targetType, DynamoSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The DynamoDB attribute value to convert. |
System.Type | targetType | The expected return type. |
DynamoSerializerOptions | options | The deserialization options. |
Returns
Type | Description |
---|---|
System.Object | An instance of type |
Overrides
ToAttributeValue(Object, Type, DynamoSerializerOptions)
The ToAttributeValue(Object, Type, DynamoSerializerOptions) method converts an instance to a DynamoDB attribute value.
Declaration
public override AttributeValue ToAttributeValue(object value, Type targetType, DynamoSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value to convert. |
System.Type | targetType | The source value type. |
DynamoSerializerOptions | options | The serialization options. |
Returns
Type | Description |
---|---|
Amazon.DynamoDBv2.Model.AttributeValue | A DynamoDB attribute value, or |