コード例 #1
0
        public IActionResult Delete(int id)
        {
            _entryRepository.Delete(id);
            TempData["message"] = "Entry deleted successfully.";

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public void DeleteEntry(long id)
        {
            var entry = GetEntry(id);

            _entryRepository.Delete(entry);
            _entryRepository.Save();
        }
コード例 #3
0
 private void LöschenButton_Click(object sender, EventArgs e)
 {
     if (SpassListe.SelectedIndex != -1)
     {
         var entryInList = _entryRepository.List().FirstOrDefault(z => z.Value == SpassListe.SelectedItem.ToString());
         _entryRepository.Delete(entryInList);
         _entryRepository.SaveChanges();
         SpassListe.Items.RemoveAt(SpassListe.SelectedIndex);
     }
     else
     {
         MessageBox.Show("Kein Element ausgewählt!");
     }
 }
コード例 #4
0
 public void Delete(int id)
 {
     EntryRepository.Delete(id);
 }
コード例 #5
0
ファイル: EntryManager.cs プロジェクト: ufukgulec/Platform
 /// <summary>
 /// Id'ye göre Entry ve bağlı olduğu tabloları(Reply,Like) siler.
 /// </summary>
 /// <param name="id">EntryID</param>
 /// <returns>True/False</returns>
 public bool Delete(int id)
 {
     return(_entryRepository.Delete(id));
 }
コード例 #6
0
        public bool Delete(int?entryId)
        {
            var entry = _entryRepo.Get(u => u.Id == entryId, _context);

            return(entry != null?_entryRepo.Delete(entry, _context) : false);
        }
コード例 #7
0
        public async Task DeleteById(int id)
        {
            var entry = await Repository.GetByIdAsync(id);

            Repository.Delete(entry);
        }
コード例 #8
0
 public async Task Delete(Guid entryId)
 {
     await repo.Delete(entryId);
 }