I want to get items from input list that do not exist in the database table.
I pass a list of IDs, then I want to return those IDs that do not exist in my table.
This is what I have for now:
var input = new List<string>() // list of Ids, for example count of 10
var itemsThatExistInDb = await DbContext.Set<Data>() // in table exist 100k+ records,
.AsQueryable() // can't use simple !Contains()
.Where(x => input.Contains(x.Id))
.Select(x => x.Id)
.ToListAsync();
var itemsThatNotExistInDb = input.Except(itemsThatExistInDb).ToList();
How to write a query in EF Core 2.1 to get items from my input list that do not exist in my database without using linq extensions like Except()? If it's possible, I want to get those Ids straight from my database query to DbContext