Method WithDateOnly
- Namespace
- MongoDB.Bson.Serialization.Serializers
- Assembly
- MongoDB.Bson.dll
WithDateOnly(bool)
Returns a serializer that has been reconfigured with the specified dateOnly value.
public DateTimeSerializer WithDateOnly(bool dateOnly)
Parameters
dateOnly
boolif set to
true
the values will be required to be Date's only (zero time component).
Returns
- DateTimeSerializer
The reconfigured serializer.
WithDateOnly(bool, BsonType)
Returns a serializer that has been reconfigured with the specified dateOnly value and representation.
public DateTimeSerializer WithDateOnly(bool dateOnly, BsonType representation)
Parameters
dateOnly
boolif set to
true
the values will be required to be Date's only (zero time component).representation
BsonTypeThe representation.
Returns
- DateTimeSerializer
The reconfigured serializer.