|
@@ -1,4 +1,5 @@
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
+using MafiaTelegramBot.Resources;
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
namespace MafiaTelegramBot.DataBase
|
|
@@ -7,14 +8,20 @@ namespace MafiaTelegramBot.DataBase
|
|
|
{
|
|
|
public DbSet<UserEntity> Users { get; set; }
|
|
|
//public DbSet<StatisticsEntity> Statistics { get; set; }
|
|
|
-
|
|
|
+
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
{
|
|
|
//#warning To protect potentially sensitive information in your connection string,
|
|
|
//you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263
|
|
|
//for guidance on storing connection strings.
|
|
|
-
|
|
|
- optionsBuilder.UseMySQL("server=192.168.2.2;port=3306;database=mafia;uid=mafia_bot; pwd=73*MYSQLpassword73*");
|
|
|
+
|
|
|
+ optionsBuilder.UseMySQL(
|
|
|
+ $"server={AppSettings.IpAddress};" +
|
|
|
+ $"port={AppSettings.Port};" +
|
|
|
+ $"database={AppSettings.Database};" +
|
|
|
+ $"uid={AppSettings.Uid};" +
|
|
|
+ $"pwd={AppSettings.Pwd}"
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
}
|