Class GuidUtils
Guid Utils
Inherited Members
Namespace: Microsoft.Graph.Communications.Common
Assembly: Microsoft.Graph.Communications.Common.dll
Syntax
public static class GuidUtils
Methods
EnsureNotEmpty(Guid)
Ensures Guid is not empty by generating a random guid if it is empty
Declaration
public static Guid EnsureNotEmpty(this Guid guid)
Parameters
Type | Name | Description |
---|---|---|
Guid | guid | input guid |
Returns
Type | Description |
---|---|
Guid | A guaranteed guid that is not empty |
EnsureNotEmpty(Nullable<Guid>)
Ensures Guid is not empty by generating a random guid if it is empty
Declaration
public static Guid EnsureNotEmpty(this Guid? guid)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Guid> | guid | input guid |
Returns
Type | Description |
---|---|
Guid | A guaranteed guid that is not empty |
ParseOrNew(String)
Parse and return the guid if valid else return new guid
Declaration
public static Guid ParseOrNew(string input)
Parameters
Type | Name | Description |
---|---|---|
String | input | input |
Returns
Type | Description |
---|---|
Guid | Guid of input or new guid |