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 Retrieves() => CacheManager.GetOrAdd(RetrieveLogsDataKey, key => DbContextManager.Create().Retrieves()); /// /// 保存新增的日志信息 /// /// /// public static bool Save(Log p) { var ret = DbContextManager.Create().Save(p); if (ret) CacheManager.Clear(RetrieveLogsDataKey); return ret; } } }