Skip to content

Commit

Permalink
fixing mail sender
Browse files Browse the repository at this point in the history
  • Loading branch information
ezraroi committed Jun 21, 2024
1 parent 61fe09b commit e936d50
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion MailSender/Notify.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Configuration;
using System.Text;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Configuration;
Expand Down
18 changes: 18 additions & 0 deletions Mundialito/DAL/MundialitoDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ protected override void OnConfiguring(DbContextOptionsBuilder options)
}
else
{
var db = appConfig.GetSection("App").GetValue<DBTypeEnum>("DBType", DBTypeEnum.SQLLite);
switch (db)
{
case DBTypeEnum.PostgreSQL:
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
options.UseNpgsql(_connectionString);
break;
case DBTypeEnum.SQLServer:
options.UseSqlServer(_connectionString, b => b.EnableRetryOnFailure());
break;
case DBTypeEnum.SQLLite:
options.UseSqlite(appConfig.GetConnectionString("App"));
break;
default:
throw new Exception("Unknown DB type");
}

options.UseSqlServer(_connectionString, b => b.EnableRetryOnFailure());
}
}
Expand Down

0 comments on commit e936d50

Please sign in to comment.