-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove obsolete methods from INotifier (#15631)
- Loading branch information
1 parent
88a61bd
commit 4ec7f42
Showing
3 changed files
with
5 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 3 additions & 15 deletions
18
src/OrchardCore/OrchardCore.DisplayManagement/Notify/Notifier.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,30 @@ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Html; | ||
using Microsoft.AspNetCore.Mvc.Localization; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace OrchardCore.DisplayManagement.Notify | ||
{ | ||
public class Notifier : INotifier | ||
{ | ||
private readonly List<NotifyEntry> _entries; | ||
private readonly List<NotifyEntry> _entries = []; | ||
private readonly ILogger _logger; | ||
|
||
public Notifier(ILogger<Notifier> logger) | ||
{ | ||
_entries = []; | ||
_logger = logger; | ||
} | ||
|
||
public void Add(NotifyType type, LocalizedHtmlString message) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public ValueTask AddAsync(NotifyType type, LocalizedHtmlString message) | ||
{ | ||
if (_logger.IsEnabled(LogLevel.Information)) | ||
{ | ||
_logger.LogInformation("Notification '{NotificationType}' with message '{NotificationMessage}'", type, message.ToString()); | ||
} | ||
_logger.LogInformation("Notification '{NotificationType}' with message '{NotificationMessage}'", type, message); | ||
|
||
_entries.Add(new NotifyEntry { Type = type, Message = message }); | ||
|
||
return ValueTask.CompletedTask; | ||
} | ||
|
||
public IList<NotifyEntry> List() | ||
{ | ||
return _entries; | ||
} | ||
=> _entries; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters