MessagingSystem: refactor

This commit is contained in:
Maksim Chegulov 2022-02-21 18:50:53 +03:00
parent e66375760d
commit 8640d03a5f
2 changed files with 6 additions and 7 deletions

View File

@ -29,13 +29,12 @@ namespace ASC.MessagingSystem.Models;
public class MessageTarget
{
private IEnumerable<string> _items;
public ILog Log { get; set; }
private readonly ILog _logger;
private readonly IOptionsMonitor<ILog> _option;
public MessageTarget(IOptionsMonitor<ILog> option)
{
Log = option.Get("ASC.Messaging");
_logger = option.Get("ASC.Messaging");
_option = option;
}
@ -61,7 +60,7 @@ public class MessageTarget
}
catch (Exception e)
{
Log.Error("EventMessageTarget exception", e);
_logger.Error("EventMessageTarget exception", e);
return null;
}
@ -79,7 +78,7 @@ public class MessageTarget
}
catch (Exception e)
{
Log.Error("EventMessageTarget exception", e);
_logger.Error("EventMessageTarget exception", e);
return null;
}

View File

@ -27,8 +27,8 @@ namespace ASC.MessagingSystem.Models;
public class MessageUserData
{
public int TenantId { get; private set; }
public Guid UserId { get; private set; }
public int TenantId { get; init; }
public Guid UserId { get; init; }
public MessageUserData(int tenentId, Guid userId)
{