Core/CafeLib.Core/Support/ObjectId.cs
/// <summary>
/// Convert native ObjectId to Guid.
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Convert native ObjectId to Guid.
Convert native ObjectId to Guid .
public static Guid AsGuid(ObjectId id)
        {
            var bytes = id.ToByteArray().Concat(new byte[] { 5, 5, 5, 5 }).ToArray();
            var gid = new Guid(bytes);
            return gid;
        }
public static Guid AsGuid ( ObjectId id ) { var bytes = id . ToByteArray ( ) . Concat ( new byte [ ] { 5 , 5 , 5 , 5 } ) . ToArray ( ) ; var gid = new Guid ( bytes ) ; return gid ; }
Convert native ObjectId to Guid.
Convert native ObjectId to Guid .
None
id
ObjectId
None