Example #1
0
        public async Task SetEnabled(int id, bool isEnabled)
        {
            using (var uow = UnitOfWorkProvider.Create())
            {
                var rule = await _ruleRepository.GetById(id);

                rule.IsEnabled = isEnabled;

                await uow.CommitAsync();
            }
        }
Example #2
0
 /// <summary>
 /// 根据主键获取一个规则
 /// </summary>
 /// <param name="id">规则的主键</param>
 /// <returns>一个规则</returns>
 public Rule GetById(string id)
 {
     return(repository.GetById(db, id));
 }