NewGuid VS System.Guid.NewGuid()的ToString(" D");
问题描述:
有没有差异,当你生成 NewGuid()一个GUID使用。 VS System.Guid.NewGuid()的ToString(D ); 或者他们是同样的事情
Is there a difference when you generate a GUID using NewGuid(); vs System.Guid.NewGuid().ToString("D"); or they are the same thing?
答
Guid.NewGuid()的ToString()是字符串重新GUID,即presentation返回字符串对象,而 Guid.NewGuid()返回的Guid 数据类型。
Guid.NewGuid().ToString() is string representation of GUID, i.e. returns string object, while Guid.NewGuid() returns Guid datatype.