コード例 #1
0
ファイル: UrlsFactory.cs プロジェクト: NeytChi/mini-message
        public string GetHttp()
        {
            var configurationRoot = ServerConfiguration.Get();
            var hostSettings      = configurationRoot.GetSection("HostSettings").Get <HostSettings>();

            return("http://*:" + hostSettings.PortHttp);
        }
コード例 #2
0
        public UsersController(ILogger <UsersController> logger)
        {
            var configuration = ServerConfiguration.Get();

            _logger           = logger;
            _profileCondition = new ProfileCondition(logger);
            var context = new Context(false);

            context.Database.EnsureCreated();
            _repository = new UsersRepository(context);
            _mailer     = new Mailer(OperateLoggerFactory.Get(),
                                     configuration.GetSection("SmtpSettings").Get <SmtpSettings>());
            _hostSettings = configuration.GetSection("HostSettings").Get <HostSettings>();
        }
コード例 #3
0
 public static string DatabaseConnectionForSqlConnection()
 {
     if (DatabaseConfiguration == null)
     {
         var configuration = ServerConfiguration.Get();
         DatabaseConfiguration = configuration
                                 .GetSection("DatabaseSettings")
                                 .Get <DatabaseSettings>();
     }
     return("server=" + DatabaseConfiguration.Server +
            ";database=" + DatabaseConfiguration.Database +
            ";uid=" + DatabaseConfiguration.User +
            ";pwd=" + DatabaseConfiguration.Password +
            ";");
 }
コード例 #4
0
 public static string DatabaseConnection()
 {
     if (DatabaseConfiguration == null)
     {
         var configuration = ServerConfiguration.Get();
         DatabaseConfiguration = configuration
                                 .GetSection("DatabaseSettings")
                                 .Get <DatabaseSettings>();
     }
     return("Server=" + DatabaseConfiguration.Server +
            ";Database=" + DatabaseConfiguration.Database +
            ";User="******";Pwd=" + DatabaseConfiguration.Password +
            ";Charset=utf8;");
 }