using System; using System.ComponentModel.DataAnnotations; using System.Reflection; using System.Security.Cryptography; using System.Text; namespace Win.Sfs.Shared { public static class SharedExtensions { public static Guid ToGuid(this string input) { var hash = MD5.HashData(Encoding.UTF8.GetBytes(input)); return new Guid(hash); } public static string GetDisplayName(this Enum enumValue) { var type = enumValue.GetType(); var field = type.GetField(enumValue.ToString()); return field.GetCustomAttribute()?.Name ?? field.Name; } } }