public async Task DeleteAsync(int id) { ToDo toDo = await _context.ToDos.FindAsync(id); if (toDo != null) { _context.Remove(toDo); await _context.SaveChangesAsync(); } }
/// <summary> /// Delete Customer /// </summary> /// <param name="id">customer ID</param> /// <returns></returns> public async Task DeleteAsync(int id) { Customer customer = await _context.Customers.FindAsync(id); if (customer != null) { _context.Remove(customer); await _context.SaveChangesAsync(); } }
public async Task DeleteAsync(int id) { Note note = await _context.Notes.FindAsync(id); if (note != null) { _context.Remove(note); await _context.SaveChangesAsync(); } }