C# how to create a Guid value?
Guid id = Guid.NewGuid();
Guid.NewGuid()
creates a new random guid.
There are two ways
var guid = Guid.NewGuid();
or
var guid = Guid.NewGuid().ToString();
both use the Guid class, the first creates a Guid Object, the second a Guid string.