TigerEmu/Game/LandingView/LandingViewManager.cs

25 lines
836 B
C#
Raw Normal View History

2023-10-06 19:23:27 +00:00
using Microsoft.Extensions.Logging;
using Tiger.Storage;
namespace Tiger.Game.LandingView;
public class LandingViewManager : ILandingViewManager
{
private readonly IRepository<PromoArticle> _promoArticleRepository;
private readonly ILogger<ILandingViewManager> _logger;
public LandingViewManager(IRepository<PromoArticle> promoArticleRepository, ILogger<ILandingViewManager> logger)
{
_promoArticleRepository = promoArticleRepository;
_logger = logger;
}
public ICollection<PromoArticle> PromoArticles { get; private set; } = new List<PromoArticle>();
public async Task LoadPromoArticlesAsync()
{
PromoArticles = (await _promoArticleRepository.FindByAsync()).ToList();
_logger.LogInformation("Loaded {Count} promo articles", PromoArticles.Count);
}
}