using MongoDB.Driver;
using System;
using System.Collections.Generic;
namespace Bootstrap.DataAccess.MongoDB
{
///
///
///
public class Log : DataAccess.Log
{
///
///
///
///
public override IEnumerable RetrieveLogs()
{
var log = MongoDbAccessManager.DBAccess.GetCollection("Logs");
return log.Find(l => l.LogTime >= DateTime.Now.AddDays(-7)).ToList();
}
///
///
///
///
///
public override bool SaveLog(DataAccess.Log log)
{
var logs = MongoDbAccessManager.DBAccess.GetCollection("Logs");
log.LogTime = DateTime.Now;
logs.InsertOne(log);
return true;
}
}
}