String to Guid
This is used to be common in web api's. When you must to receive the guid as a string in parameter.
Source
public static Guid ToGuid(this string value)
{
Guid.TryParse(value, out Guid result);
return result;
}
Example
string value = "cf3d75d2-59b6-4d22-b74a-daa9d3dadd64";
value.ToGuid();
Console.WriteLine(value); // output: cf3d75d2-59b6-4d22-b74a-daa9d3dadd64