using Longbow.Cache;
using Longbow.Data;
using System.Collections.Generic;
namespace Bootstrap.DataAccess
{
///
///
///
public static class LogHelper
{
///
///
///
public const string RetrieveLogsDataKey = "LogHelper-RetrieveLogs";
///
/// 查询所有日志信息
///
///
///
public static IEnumerable RetrieveLogs() => CacheManager.GetOrAdd(RetrieveLogsDataKey, key => DbAdapterManager.Create().RetrieveLogs());
///
/// 保存新增的日志信息
///
///
///
public static bool SaveLog(Log p)
{
var ret = DbAdapterManager.Create().SaveLog(p);
if (ret) CacheManager.Clear(RetrieveLogsDataKey);
return ret;
}
}
}