コード例 #1
0
 public void Save()
 {
     Key.name        = Name;
     Key.title       = Title;
     Key.description = Description;
     Key.notes       = Notes;
     Key.copyright   = Copyright;
     Key.Publish     = Publish;
     if (Key.id == 0)
     {
         IKeyManager.Insert(Key);
     }
     else
     {
         IKeyManager.Update(Key);
     }
     foreach (var literature in LiteratureItems)
     {
         if (_originalLiteratureItems.Contains(literature))
         {
             IKeyManager.Update(literature);
             _originalLiteratureItems.Remove(literature);
         }
         else
         {
             literature.key_id = Key.id;
             IKeyManager.Insert(literature);
         }
     }
     foreach (var literature in _originalLiteratureItems)
     {
         IKeyManager.Delete(literature);
     }
     _originalLiteratureItems.Clear();
 }
コード例 #2
0
ファイル: KeyController.cs プロジェクト: shahedk/ApiGateway
 public async Task Delete(string id)
 {
     await _manager.Delete(ApiKey, id);
 }