using System.Globalization;
public static void Main()
public static Guid StringToGuid(this string guid)
if (string.IsNullOrEmpty(guid)) throw new ArgumentException();
Guid.TryParse(guid, out newGuid);
if (result.IsNullOrEmptyGuid()) throw new ArgumentException();
public static bool IsNullOrEmptyGuid(Guid guid)
return guid == default(Guid) || guid == Guid.Empty;