If you use the Entity Framework, uniqueidentifier data is converted to Guid.
The value of this Guid, represented as a sequence of lowercase hexadecimal digits in the specified format.
If you need consistency in the application, you can use one format when you get a string from Guid.
Check Guid.ToString (String) Method for Available Formats
There may be a place where you get guid as a string from the database, so this will be infinite uppercase. (check the stored procedures "Views, etc.")
To avoid this problem, you must make sure that you return the uniqueidentifier as it is, do not convert to varchar, and also switch to one multi-line format when converting to a string.
For other operations, such as comparison, etc. You can use the guid operators.
source share