This commit is contained in:
2025-04-30 09:51:36 +08:00
parent 561881c9aa
commit 09afa239a6
848 changed files with 385870 additions and 205 deletions

View File

@@ -0,0 +1,20 @@
namespace Yes.Application.Admins.Articles
{
public record ArticleAddedEvent(int ArticleId) : INotification;
public class ArticleAddedEventHandler(BlogDbContext db, IMemoryCache cache) : INotificationHandler<ArticleAddedEvent>
{
private readonly BlogDbContext _db = db;
private readonly IMemoryCache _cache = cache;
public async Task Handle(ArticleAddedEvent notification, CancellationToken cancellationToken)
{
var articleId = notification.ArticleId;
_cache.Remove("Archives");
}
}
}