Merging RestAPI to EmployeeApp
This commit is contained in:
commit
ad23e94dea
@ -11,7 +11,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreDataModels", "
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreDatabaseImplement", "..\ComputerStoreDatabaseImplement\ComputerStoreDatabaseImplement.csproj", "{24D66D03-F9DA-46C0-8C52-F55DDACDE8AF}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreDatabaseImplement", "..\ComputerStoreDatabaseImplement\ComputerStoreDatabaseImplement.csproj", "{24D66D03-F9DA-46C0-8C52-F55DDACDE8AF}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputerStoreRestAPI", "..\ComputerStoreRestAPI\ComputerStoreRestAPI.csproj", "{11E7B5B7-7AF5-4E1E-837F-E6645D3C0EFB}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreRestAPI", "..\ComputerStoreRestAPI\ComputerStoreRestAPI.csproj", "{11E7B5B7-7AF5-4E1E-837F-E6645D3C0EFB}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputerStoreEmployeeApp", "..\ComputerStoreEmployeeApp\ComputerStoreEmployeeApp.csproj", "{E1091CF6-5350-402F-A305-2973C96D2AC5}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputerStoreEmployeeApp", "..\ComputerStoreEmployeeApp\ComputerStoreEmployeeApp.csproj", "{E1091CF6-5350-402F-A305-2973C96D2AC5}"
|
||||||
EndProject
|
EndProject
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using ComputerStoreBusinessLogic.BusinessLogic;
|
using ComputerStoreBusinessLogic.BusinessLogic;
|
||||||
|
using ComputerStoreBusinessLogic.MailStuff;
|
||||||
using ComputerStoreContracts.BindingModels;
|
using ComputerStoreContracts.BindingModels;
|
||||||
using ComputerStoreContracts.BusinessLogicContracts;
|
using ComputerStoreContracts.BusinessLogicContracts;
|
||||||
using ComputerStoreContracts.StorageContracts;
|
using ComputerStoreContracts.StorageContracts;
|
||||||
@ -30,6 +31,8 @@ builder.Services.AddTransient<IConsignmentLogic,ConsignmentLogic>();
|
|||||||
builder.Services.AddTransient<IRequestComponentLogic, RequestComponentLogic>();
|
builder.Services.AddTransient<IRequestComponentLogic, RequestComponentLogic>();
|
||||||
builder.Services.AddTransient<IRequestLogic, RequestLogic>();
|
builder.Services.AddTransient<IRequestLogic, RequestLogic>();
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<AbstractMail, MailKit>();
|
||||||
|
|
||||||
builder.Services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
|
builder.Services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
|
||||||
|
|
||||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||||
@ -40,8 +43,17 @@ AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
|||||||
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
var mailSender = app.Services.GetService<AbstractMail>();
|
||||||
|
|
||||||
|
mailSender?.MailConfig(new MailConfigBindingModel
|
||||||
|
{
|
||||||
|
Login = builder.Configuration?.GetSection("MailLogin")?.Value?.ToString() ?? string.Empty,
|
||||||
|
Password = builder.Configuration?.GetSection("MailPassword")?.Value?.ToString() ?? string.Empty,
|
||||||
|
SmtpClientHost = builder.Configuration?.GetSection("SmtpClientHost")?.Value?.ToString() ?? string.Empty,
|
||||||
|
SmtpClientPort = Convert.ToInt32(builder.Configuration?.GetSection("SmtpClientPort")?.Value?.ToString()),
|
||||||
|
PopHost = builder.Configuration?.GetSection("PopHost")?.Value?.ToString() ?? string.Empty,
|
||||||
|
PopPort = Convert.ToInt32(builder.Configuration?.GetSection("PopPort")?.Value?.ToString())
|
||||||
|
});
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
|
@ -5,5 +5,12 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*"
|
"AllowedHosts": "*",
|
||||||
|
|
||||||
|
"SmtpClientHost": "smtp.rambler.ru",
|
||||||
|
"SmtpClientPort": "587",
|
||||||
|
"PopHost": "pop.rambler.ru",
|
||||||
|
"PopPort": "995",
|
||||||
|
"MailLogin": "tmpmailforlabs@rambler.ru",
|
||||||
|
"MailPassword": "0paRVbmA"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user