score:0

i think you can query it like this:

var input = new list<string>() // list of ids

       list<string> itemsthatexist = new list<string>();

       var itemsthatnotexist  = await dbcontext.set<data>()
                .asqueryable()
                .todictionaryasync(_ => _.id, _ => _);

        foreach (var item in input)
        {
            if(allitems.containskey(item)){
                itemsthatexist.add(item);
                itemsthatnotexist.remove(item);
            }
        }

score:0

if you don't want to use !contain you can use logical method as below:

datattable is the content of your table.

list<string> fulllist = new list<string>() { "3", "1", "2" }; //or any dynamic list content or class list based on requirement.
list<string> itemsthatnotexistindb = new list<string>(); //new container list same as fulllist
            foreach (var item in fulllist)
            {
                var isremoved = datatable.removeall(a => a.id == item) == 1 ? true : false;
                if (isremoved)
                {
                    itemsthatnotexistindb.add(item);
                }
            }

Related Query

More Query from same tag