This code is from my sql query
SELECT Branchname
FROM Branch
WHERE NOT EXISTS (SELECT Branchname FROM vBranching
WHERE Branch.Branchname = vBranching.Branchname AND UserName = 'xCuttiepies');
iwant to execute it into linq c# web api
Its look like this
var Branch = _dbcontext.Branches.Select(c => c.Branchname).ToList();
var vBranching = _dbcontext.VBranchings.Select(a => a.BranchName).ToList();
var ass = Branch.Where(!Branch.Exists(Branch == vBranching));
return Ok(vBranching);
In Branch == vBranching it says cannot convert from bool to System.Predicate<string>
I want to fetch the data that not exists on that different tables.
You souldn't be using
ToListexcept right at the end, and your lambda syntax is off, and the equivalent ofEXISTSisAny. You are also returning the wrong value.