Delete record in bulk in .net core(API) using linq.

Aman Sharma
0

 Delete records in bulk:

If you want to delete records in bulk, user RemoveRange method.


  var userRoles = _context.UserRoles.Where(u => u.UserId == item.UserId);

  if (userRoles!= null) {

      _context.UserRoles.RemoveRange(userRoles);

      _context.SaveChanges();

        }

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !