ПИбд-22 Боровков М В 7 лабораторная работа #8
8
.gitignore
vendored
8
.gitignore
vendored
@ -371,8 +371,6 @@ healthchecksdb
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
*/Migrations/*
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
@ -400,8 +398,4 @@ FodyWeavers.xsd
|
||||
# JetBrains Rider
|
||||
*.sln.iml
|
||||
|
||||
/SushiBar/SushiBarDatabaseImplement/Migrations/20240522053944_lab7.Designer.cs
|
||||
/SushiBar/SushiBarDatabaseImplement/Migrations/20240522053944_lab7.cs
|
||||
/SushiBar/SushiBarDatabaseImplement/Migrations/SushiBarDatabaseModelSnapshot.cs
|
||||
/SushiBar/SushiBarDatabaseImplement/Migrations/20240507181620_lab6.Designer.cs
|
||||
/SushiBar/SushiBarDatabaseImplement/Migrations/20240507181620_lab6.cs
|
||||
/SushiBar/SushiBarDatabaseImplement/Migrations/
|
||||
|
@ -30,6 +30,7 @@ namespace SushiBar
|
||||
var services = new ServiceCollection();
|
||||
ConfigureServices(services);
|
||||
_serviceProvider = services.BuildServiceProvider();
|
||||
|
||||
try
|
||||
{
|
||||
var mailSender = _serviceProvider.GetService<AbstractMailWorker>();
|
||||
@ -45,6 +46,12 @@ namespace SushiBar
|
||||
var timer = new System.Threading.Timer(new
|
||||
TimerCallback(MailCheck!), null, 0, 100000);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var logger = _serviceProvider.GetService<ILogger>();
|
||||
logger?.LogError(ex, "Îøèáêà ðàáîòû ñ ïî÷òîé");
|
||||
}
|
||||
|
||||
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
|
||||
}
|
||||
private static void ConfigureServices(ServiceCollection services)
|
||||
|
@ -59,7 +59,8 @@ namespace SushiBarBusinessLogic.BusinessLogics
|
||||
return false;
|
||||
}
|
||||
model.Status = OrderStatus.Принят;
|
||||
if (_orderStorage.Insert(model) == null)
|
||||
var res = _orderStorage.Insert(model);
|
||||
if (res == null)
|
||||
{
|
||||
_logger.LogWarning("Insert operation failed");
|
||||
return false;
|
||||
|
@ -9,7 +9,7 @@ namespace SushiBarDatabaseImplement
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseNpgsql(@"Host=localhost;Database=SushiBar_db6;Username=postgres;Password=postgres");
|
||||
optionsBuilder.UseNpgsql(@"Host=localhost;Database=SushiBar_db7;Username=postgres;Password=postgres");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||
|
Loading…
Reference in New Issue
Block a user