Files
Yi.Admin/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/RedisInitExtend.cs
chenchun f5fb2ea17b 重构代码
重构代码
2022-04-02 17:44:50 +08:00

36 lines
1019 B
C#

using log4net;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Core;
namespace Yi.Framework.WebCore.MiddlewareExtend
{
public static class RedisInitExtend
{
private static readonly ILog log = LogManager.GetLogger(typeof(RedisInitExtend));
public static void UseRedisSeedInitService(this IApplicationBuilder app, CacheClientDB _cacheClientDB)
{
if (Appsettings.appBool("RedisSeed_Enabled"))
{
if (app == null) throw new ArgumentNullException(nameof(app));
try
{
//RedisInit.Seed(_cacheClientDB);
}
catch (Exception e)
{
log.Error($"Error occured seeding the RedisInit.\n{e.Message}");
throw;
}
}
}
}
}