Table of Contents

Class FlexibleGuidAttribute

Namespace
Tharga.MongoDB
Assembly
Tharga.MongoDB.dll

Overrides the global GuidStorageFormat for a single property. The serializer will still read all three formats (Standard, CSharpLegacy, String), but will write using the specified format.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public sealed class FlexibleGuidAttribute : Attribute, IBsonMemberMapAttribute
Inheritance
FlexibleGuidAttribute
Implements
IBsonMemberMapAttribute
Inherited Members

Constructors

FlexibleGuidAttribute(GuidStorageFormat)

public FlexibleGuidAttribute(GuidStorageFormat writeFormat = GuidStorageFormat.Standard)

Parameters

writeFormat GuidStorageFormat

Properties

WriteFormat

public GuidStorageFormat WriteFormat { get; }

Property Value

GuidStorageFormat

Methods

Apply(BsonMemberMap)

Applies the attribute to the member map.

public void Apply(BsonMemberMap memberMap)

Parameters

memberMap BsonMemberMap

The member map.