LabWork07 Fixes: link from client to his messages has been implemented + RestAPI behavior of AbstractMailEmployee has been changed to Singleton.

This commit is contained in:
Yuee Shiness 2023-04-23 18:52:10 +04:00
parent b9fb91e4ff
commit 692e1a4799
3 changed files with 5 additions and 2 deletions

View File

@ -35,7 +35,7 @@ namespace DressAtelierBusinessLogic.MailEmployee
_smtpClientPort = config.SmtpClientPort;
_popHost = config.PopHost;
_popPort = config.PopPort;
_logger.LogDebug("Config: {login}, {password}, {clientHost}, {clientPOrt}, {popHost}, {popPort}", _mailLogin, _mailPassword, _smtpClientHost, _smtpClientPort, _popHost, _popPort);
_logger.LogDebug("Config: {login}, {password}, {clientHost}, {clientPort}, {popHost}, {popPort}", _mailLogin, _mailPassword, _smtpClientHost, _smtpClientPort, _popHost, _popPort);
}
public async void MailSendAsync(MailSendInfoBindingModel info)

View File

@ -26,6 +26,9 @@ namespace DressAtelierDatabaseImplement.Models
[ForeignKey("ClientID")]
public virtual List<Order> Orders { get; set; } = new();
[ForeignKey("ClientID")]
public virtual List<MessageInfo>? Messages { get; set; } = new();
public static Client? Create(ClientBindingModel? model)
{
if (model == null)

View File

@ -27,7 +27,7 @@ builder.Services.AddTransient<IDressLogic, DressLogic>();
builder.Services.AddTransient<IEmployeeLogic, EmployeeLogic>();
builder.Services.AddTransient<IMessageInfoLogic,MessageInfoLogic>();
builder.Services.AddTransient<AbstractMailEmployee,MailKitEmployee>();
builder.Services.AddSingleton<AbstractMailEmployee,MailKitEmployee>();
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle