Example #1
0
 public void Update(Settings item)
 {
     if (this._context.Settings.Local.Select(x => x.Id == item.Id).Any())
     {
         throw new ApplicationException("对象已经存在,你不需要调用更新。");
     }
     this._context.Entry(item).State = EntityState.Modified;
 }
Example #2
0
 public void Save(Settings settings)
 {
     this._settingsRepository.Update(settings);
 }
Example #3
0
 public Settings Add(Settings item)
 {
     return this._context.Settings.Add(item);
 }
Example #4
0
 public Settings Add(Settings settings)
 {
     return this._settingsRepository.Add(settings);
 }