CSharpTest.Net
DbGuid Constructor(Guid)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Data Namespace > DbGuid Structure > DbGuid Constructor : DbGuid Constructor(Guid)

guid

Glossary Item Box

Creates a DbGuid from a System.Guid instance.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal guid As Guid _
)
C# 
public DbGuid( 
   Guid guid
)

Parameters

guid

Remarks

Unexpected results may occur if using System.Guid.NewGuid() to initialize this instance. Instead use DbGuid.NewGuid() to construct a new identifier. This is provided primarily for conversion and use with other systems (i.e. SqlServer, etc).

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)

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys