What is the default value for Guid?

anchor picture anchor · Jun 22, 2015 · Viewed 103.3k times · Source

The default value for int is 0 , for string is "" and for boolean it is false. Could someone please clarify what the default value for guid is?

Answer

Peter Rasmussen picture Peter Rasmussen · Jun 22, 2015

You can use these methods to get an empty guid. The result will be a guid with all it's digits being 0's - "00000000-0000-0000-0000-000000000000".

new Guid()

default(Guid)

Guid.Empty