Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public enum AppSettings
  2. {
  3.     MySetting
  4. }
  5.  
  6. public class Extentions
  7. {
  8.     public static string Value(this AppSettings source)
  9.     {
  10.         return WebConfigurationManager.AppSettings[source.ToString()];
  11.     }
  12.    
  13.     public static string ToHexString(this IEnumerable<byte> source)
  14.     {
  15.         var stringBuilder = source.Aggregate(new StringBuilder(), (builder, aByte) => builder.AppendFormat("{0:x2}", aByte));
  16.         return stringBuilder.ToString();
  17.     }
  18. }