예제 #1
0
        public async Task DeleteAsync(int id)
        {
            ToDo toDo = await _context.ToDos.FindAsync(id);

            if (toDo != null)
            {
                _context.Remove(toDo);
                await _context.SaveChangesAsync();
            }
        }
예제 #2
0
        /// <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();
            }
        }
예제 #3
0
        public async Task DeleteAsync(int id)
        {
            Note note = await _context.Notes.FindAsync(id);

            if (note != null)
            {
                _context.Remove(note);
                await _context.SaveChangesAsync();
            }
        }