Configs.cs 716 B

12345678910111213141516171819202122232425262728293031323334
  1. using Microsoft.Extensions.Configuration;
  2. namespace CZFW.Core
  3. {
  4. public class ConfigHelper
  5. {
  6. public static IConfiguration Configs;
  7. public static string GetValue(string key)
  8. {
  9. return Configs[key];
  10. }
  11. public static TVal GetValue<TVal>(string key)
  12. {
  13. var res = Utility.Parse<TVal>(Configs[key]);
  14. return res;
  15. }
  16. public static string UserSessionName
  17. {
  18. get {
  19. return GetValue("UserSessionName");
  20. }
  21. }
  22. public static string TestUrlBase
  23. {
  24. get
  25. {
  26. return GetValue("HostRoot");
  27. }
  28. }
  29. }
  30. }