public async Task DeleteAll(int contentId) { var contents = await _context.ContentVersions.Where(w => w.ContentId == contentId).ToListAsync(); _context.Remove(contents); await _context.SaveChangesAsync(); }
public async Task OnDeleteAsync(Guid roleId) { var role = await _context.Roles.FindAsync(roleId); if (role != null) { _context.Remove(role); await _context.SaveChangesAsync(); } await SetAllRoles(); }