C# how to create a Guid value?

后端 未结 11 2150
旧时难觅i
旧时难觅i 2020-11-27 09:58

One field of our struct is Guid type. How to generate a valid value for it?

11条回答
  •  猫巷女王i
    2020-11-27 10:40

    var guid = new Guid();
    

    Hey, its a 'valid', although not very useful, Guid.

    (the guid is all zeros, if you don't know. Sometimes this is needed to indicate no guid, in cases where you don't want to use a nullable Guid)

提交回复
热议问题