How to create a Guid with all zero elements?

Ehsan88 picture Ehsan88 · Sep 2, 2013 · Viewed 8.8k times · Source

How to create a Guid that all of its elements are zero. i.e. {00000000-0000-0000-0000-000000000000}. I could use:

Guid.Parse("{00000000-0000-0000-0000-000000000000}")

But is there any easier method for that ?

Answer

Matthew Watson picture Matthew Watson · Sep 2, 2013

As simple as this:

var guid = Guid.Empty;