/// <summary>
        ///
        /// </summary>
        /// <param name="user"></param>
        public void Delete(int Id)
        {
            var user = _context.Users.FirstOrDefault(f => f.Id == Id);

            _context.Users.Remove(user);
            _context.SaveChanges();
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Id"></param>
        public void Delete(int Id)
        {
            _context.Authors.Remove(_context.Authors.Where(f => f.Id == Id).FirstOrDefault());

            _context.SaveChanges();
        }
 public void Delete(int Id)
 {
     _context.Remove(_context.Books.FirstOrDefault(f => f.Id == Id));
     _context.SaveChanges();
 }