﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;
using ABoard.DAL.Abstract;

namespace ABoard.Web.ViewModels
{
    public class StatsViewModel
    {
        [DisplayName("Всего досок")]
        public int TotalBoards { get; set; }

        [DisplayName("Всего тредов")]
        public int TotalThreads { get; set; }

        [DisplayName("Всего постов")]
        public int TotalPosts { get; set; }

        [DisplayName("Всего изображений")]
        public int TotalPictures { get; set; }

        public StatsViewModel(IDbRepository repo)
        {
            TotalBoards = repo.Boards.Count();
            TotalThreads = repo.Threads.Count();
            TotalPosts = repo.Posts.Count();
            TotalPictures = repo.Pictures.Count();
        }
    }
}