diff --git a/src/BirdsiteLive/Controllers/StatisticsController.cs b/src/BirdsiteLive/Controllers/StatisticsController.cs new file mode 100644 index 0000000..90d58e2 --- /dev/null +++ b/src/BirdsiteLive/Controllers/StatisticsController.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using BirdsiteLive.DAL.Contracts; +using BirdsiteLive.Models.StatisticsModels; +using Microsoft.AspNetCore.Mvc; + +namespace BirdsiteLive.Controllers +{ + public class StatisticsController : Controller + { + private readonly ITwitterUserDal _twitterUserDal; + private readonly IFollowersDal _followersDal; + + #region Ctor + public StatisticsController(ITwitterUserDal twitterUserDal, IFollowersDal followersDal) + { + _twitterUserDal = twitterUserDal; + _followersDal = followersDal; + } + #endregion + + public async Task Index() + { + var stats = new Statistics + { + FollowersCount = await _followersDal.GetFollowersCountAsync(), + TwitterUserCount = await _twitterUserDal.GetTwitterUsersCountAsync() + }; + return View(stats); + } + } +} diff --git a/src/BirdsiteLive/Models/StatisticsModels/Statistics.cs b/src/BirdsiteLive/Models/StatisticsModels/Statistics.cs new file mode 100644 index 0000000..bf62e58 --- /dev/null +++ b/src/BirdsiteLive/Models/StatisticsModels/Statistics.cs @@ -0,0 +1,8 @@ +namespace BirdsiteLive.Models.StatisticsModels +{ + public class Statistics + { + public int FollowersCount { get; set; } + public int TwitterUserCount { get; set; } + } +} \ No newline at end of file diff --git a/src/BirdsiteLive/Views/Statistics/Index.cshtml b/src/BirdsiteLive/Views/Statistics/Index.cshtml new file mode 100644 index 0000000..31dc9f7 --- /dev/null +++ b/src/BirdsiteLive/Views/Statistics/Index.cshtml @@ -0,0 +1,12 @@ +@model BirdsiteLive.Models.StatisticsModels.Statistics + +@{ + ViewBag.Title = "Statistics"; +} + +

Statistics

+ + \ No newline at end of file