25 lines
836 B
C#
25 lines
836 B
C#
|
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);
|
||
|
}
|
||
|
}
|