dotConnect for MongoDB Documentation
Devart.Data.MongoDB Namespace / MongoDBField Class / AsGuid Property

On this page
    AsGuid Property
    On this page
    Gets or sets the value of the field as a Guid. A binary value of subtype 4, or of subtype 3 in the byte order of the GuidFormat of the document, is read as a UUID, and a string is parsed. Returns a null reference (Nothing in Visual Basic) for a missing field or a BSON a null reference (Nothing in Visual Basic); throws System.InvalidCastException for other binary data and System.InvalidOperationException for the other types. The value is written in the GuidFormat of the document.
    Syntax
    'Declaration
     
    Public Property AsGuid As Nullable(Of Guid)
    public Nullable<Guid> AsGuid {get; set;}
    See Also