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(); }
public async Task Delete(string id) { await _manager.Delete(ApiKey, id); }