You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
990 B
C#

//----------SysConfig开始----------
using System;
using System.Threading.Tasks;
using Admin.Core.IRepository;
using Admin.Core.IService.ISys;
using Admin.Core.Model.Sys;
namespace Admin.Core.Service.Sys
{
/// <summary>
/// 参数配置表Service
/// </summary>
public partial class SysConfigService : BaseServices<SysConfig>, ISysConfigService
{
IBaseRepository<SysConfig> dal;
public SysConfigService(IBaseRepository<SysConfig> dal)
{
this.dal = dal;
BaseDal = dal;
}
/// <summary>
/// 检查参数Key是否存在
/// </summary>
/// <param name="sysConfig"></param>
/// <returns></returns>
public async Task<bool> CheckConfigKeyUnique(SysConfig sysConfig)
{
return (await dal.QueryAsync(x => x.ConfigID != sysConfig.ConfigID && x.ConfigKey == sysConfig.ConfigKey)).Count > 0;
}
}
}
//----------SysConfig结束----------