Check Guid

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have a class (Box) where a property is a Guid, ID.
How can I test if this property was defined or not?

For example:
Box myBox = new Box();
myBox.Name = "Contacts"

if (myBox.Id "is not defined") { // Some code }

Can a Guid be null?

Thanks,
Miguel
 
Hello,

I have a class (Box) where a property is a Guid, ID.
How can I test if this property was defined or not?

For example:
Box myBox = new Box();
myBox.Name = "Contacts"

if (myBox.Id "is not defined") { // Some code }

Can a Guid be null?
[...]

Guid is a value-type, and cannot be null. Use Guid.Empty.

Regards,
 
Back
Top