score:0
I rewrote the query to be exactly like the sql query, i believe that this is the way:
var firstQuery = (from u in this.ViewSelectorControl.LDReviewContext.GetTable<UserViewDoc>()
where IDs.Contains(u.UVID)
select u.DocID).Distinct();
var innerQuery = (from u in this.ViewSelectorControl.LDReviewContext.GetTable<UserViewDoc>()
join uvh in this.ViewSelectorControl.LDReviewContext.GetTable<UserViewHeader>() on uvh.UVID equals u.UVID
where IDs.Contains(u.UIVD) == false
&& uvh.IsLock
select u.DocID).Distinct();
var resultQuery = from f in firstQuery
join i in innerQuery on i equals f into lout
from i in lout.DefaultIfEmpty()
where i == null
select f;
Source: stackoverflow.com
Related Query
- Converting left outer join on two queries to LINQ
- Left outer join using LINQ -- understanding the code
- VB.Net LINQ - left outer join between two datatables - limit to one row
- How to left outer join for two unequal lists in linq
- LEFT OUTER JOIN on two Dictionary<int, string> using LINQ
- Need help in Linq Queries left Outer Join
- Converting SQL to LINQ (inner join into a left outer join) C#
- Linq two left outer join Error Non-static method requires a target
- Linq Left Outer Join Two Tables on Two Fields
- Converting Oracle SQL query with left outer join to Linq
- LINQ to SQL - Left OUTER Join with two joins not working
- LEFT OUTER JOIN in LINQ
- How do you perform a left outer join using linq extension methods
- LINQ to SQL - Left Outer Join with multiple join conditions
- LINQ to SQL Left Outer Join
- LINQ to SQL multiple tables left outer join
- How to limit a LINQ left outer join to one row
- left outer join in lambda/method syntax in Linq
- Extension method for IQueryable left outer join using LINQ
- How to Left Outer Join two DataTables in c#?
- Linq - Left outer join with dot notation
- LINQ left outer join query error: OuterApply did not have the appropriate keys
- Left join on two Lists and maintain one property from the right with Linq
- Linq left outer join with custom comparator
- Linq Left Outer Join - DefaultIfEmpty Error
- Left Outer Join - LINQ to Datatable
- linq to sql: specifying JOIN instead of LEFT OUTER JOIN
- EF Linq to Entities calling ToList() on entity set generates SQL command containing multiple left outer join
- How can I implement a LEFT OUTER JOIN in LINQ using lambda syntax on Entity Framework Core 2.0?
- Unable to convert SQL Query to LINQ Query for Left Outer Join
More Query from same tag
- Linq query does not return data
- LINQ aggregating multiple IEnumerables into one?
- Procedure which modifies incoming array of double by Normalizing (without using Linq)
- Method 'System.Object DynamicInvoke(System.Object[])' has no supported translation to SQL
- Using LINQ to fill a List<object> from xml
- Linq-To-Entities connection strings for for multiple edmx files
- Generate range between two strings [AA] -> [CD] or [CCC] -> [DMK]
- C# linq with server based database
- Change datagrid selected item using two comboboxes
- At least one one object must implement Icomparable
- How to alias a column name in LINQ at runtime?
- Iterating Through a List and Conditionally Setting a Member - Comparison Of Approaches
- Linq Xml - Find attributes by value
- LINQ to Datatable Group by and return all columns
- Linq Count item from multiple tables
- Returning an anonymous type when using context.Object.SqlQuery
- Finding a single record in a table step-by-step by different requests
- Select all columns after JOIN in LINQ
- LINQ Order by another property is the first property is equal to a given value
- Linq query for NOT IN on joined table
- LINQ result to view
- Attempting to obtain properties / fields from an (anonymous class) object linq is creating
- Generic hierarchy filter of nested classes in Linq
- Linq Query Timing Out
- Correct syntax to define an IQueryable<TSource>.OrderBy( ) like method
- Compare same DataTable by certain columns, return mismatches to CopyToDataTable()
- Select all messages but not if the subject id is the same
- How to query DataGridView without Linq
- Search for whole word with Linq to SQL
- Reliably detecting compiler generated classes in C# expression trees