31 lines
786 B
C#
31 lines
786 B
C#
using ResourcesManager.Interfaces;
|
|
using ResourcesManager.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace ResourcesManager.Repositories
|
|
{
|
|
public class StatisticRepository : BaseRepository, IStatisticRepository
|
|
{
|
|
public StatisticRepository(ApplicationDbContext context) : base(context) { }
|
|
|
|
public StatisticModel GetStatisticByID(int id)
|
|
{
|
|
return Context.Statistic.Find(id);
|
|
}
|
|
|
|
public IEnumerable<StatisticModel> GetStatistics()
|
|
{
|
|
return Context.Statistic;
|
|
}
|
|
|
|
public bool InsertStatistic(StatisticModel statistic)
|
|
{
|
|
Context.Statistic.Add(statistic);
|
|
Save();
|
|
return true;
|
|
}
|
|
}
|
|
} |