public string GetHttp() { var configurationRoot = ServerConfiguration.Get(); var hostSettings = configurationRoot.GetSection("HostSettings").Get <HostSettings>(); return("http://*:" + hostSettings.PortHttp); }
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>(); }
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 + ";"); }
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;"); }