MyTrelloConfig.cs 762 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Configuration;
  4. using System.Linq;
  5. using System.Web;
  6. using MyTrelloWeb.VCommon.Logging;
  7. namespace MyTrelloWeb
  8. {
  9. public class MyTrelloConfig
  10. {
  11. public static string DefaultConnectionString { get; private set; }
  12. public static void Init()
  13. {
  14. Logger.Info("Init Application...");
  15. DefaultConnectionString = ConfigurationManager.ConnectionStrings["default"].ConnectionString;
  16. if (string.IsNullOrWhiteSpace(DefaultConnectionString)) throw new ConfigurationErrorsException("DefaultConnectionString");
  17. Logger.Info($"{nameof(DefaultConnectionString)} Loaded");
  18. Logger.Info("Init Application OK");
  19. }
  20. }
  21. }