CSharpTest.Net
DbGuid Structure
Members  Example  See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Data Namespace : DbGuid Structure

Glossary Item Box

A Guid struct for creating sequentially advancing unique identifiers

Syntax

Visual Basic (Declaration) 
Public Structure DbGuid 
   Inherits System.ValueType
C# 
public struct DbGuid : System.ValueType 

Remarks

Bits - usage 00-03 - Reserved, always 000 if generated with DbGuid.NewGuid() 03-52 - Represent bits 3-52 of the DateTime.UtcNow.Ticks value 52-80 - 25 bits of incrementing numeric value 64-66 - Guid type constant of 111, or 001 if IsSqlGuid is true 76-128- Randomly generated bytes

Example

Library/Library.Test/TestDbGuid.cs

C#Copy Code
DbGuid testA = DbGuid.NewGuid();
TestEquality(testA, testA, true);
TestEquality(testA, DbGuid.NewGuid(), false);
TestEquality(testA, new DbGuid(Guid.NewGuid()), false);
TestEquality(testA, testA.ToSqlGuid(), true);
TestEquality(testA, testA.ToSqlGuid().ToSequenceGuid(), true);
VB.NETCopy Code
Dim testA As DbGuid = DbGuid.NewGuid()
TestEquality(testA, testA, True)
TestEquality(testA, DbGuid.NewGuid(), False)
TestEquality(testA, New DbGuid(Guid.NewGuid()), False)
TestEquality(testA, testA.ToSqlGuid(), True)
TestEquality(testA, testA.ToSqlGuid().ToSequenceGuid(), True)

Inheritance Hierarchy

System.Object
   System.ValueType
      CSharpTest.Net.Data.DbGuid

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys