score:2
The problem is in:
from ccfa in ccfaJoin.DefaultIfEmpty(new EmployeeCustomFormAttributeHeader())
Such a query construction should be used only with collections like db sets or queries not DefaultIfEmpty which however is IEnumerable but EF Core treats it as single value (which really in sql query result is null if there is no match) wherever it is used.
You should change it to:
let ccfa = ccfaJoin.DefaultIfEmpty(new EmployeeCustomFormAttributeHeader())
And it should work as expected.
Source: stackoverflow.com
Related Query
- DefaultIfEmpty issues with linq statement
- Issues with LINQ statement with defining an element of a collection
- Issues with .NET Linq statement
- Linq Join With Include Statement
- Linq Query with a Where clause in an Include statement
- How to combine 2different IQueryable/List/Collection with same base class? LINQ Union and Covariance issues
- List to Dictionary with incremental keys in one line LINQ statement
- How to introduce Let keyword inside Linq statement with Group by
- Unwieldy LINQ statement with multiple search criteria
- LINQ groupby statement with key
- LINQ Source Code Available
- Use == operator with generic type in a Where Linq statement
- How to construct a having statement in linq with a max value?
- Linq with where clause in many-to-many EF Code First object
- LINQ Query with both CASE statement and SUM function
- LINQ to SQL Join issues with FirstOrDefault()
- A linq statement with multiple group by columns not allowing a thenby
- Linq with DefaultIfEmpty with select new {}
- I'm trying to simplify with linq a statement that takes 2 lists of numbers and subtracts the first one from the second one
- how to deal with exception in LINQ Select statement
- Programmatically building a query with LINQ statement with entity framework
- Linq statement with two where clauses
- Either an issue with my linq statement or with my GetCollection<T>()
- Issues with DateTime.AddMinutes() in Dynamic LINQ Query
- Split list into two lists with single LINQ statement
- Entity Framework - LINQ statement with WHERE clause based on NULLABLE parameter
- C# - Linq optimize code with List and Where clause
- Select method missing from intellisense with Linq statement
- select from linq statement with await
- Linq statement with mutiple OrderBy clauses not working
More Query from same tag
- c# linq 'potentially' grouping and differences
- something wrong reading XML LINQ
- Maximum Date of record with LINQ
- How to use Linq instead of SQL Injection query for custom search
- Looking to pass entity as generic type and extract common functionality
- How to get all the values from an SQL Query C#
- Linq Left Outer Join C#
- How to use TryCatch Statement in ToDictionary C#?
- LINQ querying complex many to many entities
- How to convert an anonymously typed List to List<T>?
- LINQ query with variable in where clause
- How to intersect list in c#?
- XML continuously updating values
- Unable to cast object of type 'System.DBNull' to type 'System.String' On getting all Products
- Extension method (like Take()) not available for the LINQ query, Any reason why?
- Filter records using Linq on an Enum type
- Query which returns results only if all (non-primitive) values from a compared enumerable are contained in the target enumerable
- HQL vs Linq to objects
- Dynamically Build Include with Where Filter
- Linq - How to use a variable of type List<Entity> in Where clause
- parsing an xmldocument from a webrequest
- Get array values from specific index with specified length
- Linq query with subquery
- XML linq query lists first elements but not all
- Linq with a long where clause
- getting uppermost descendant in LINQ XML
- Adding values using LINQ to an object property with a Dictionary property
- Net Core 3.1 Entity Framework: Get all records where a property is NOT included
- Coalesce in Dynamic Linq
- How to remove duplicate records from LINQ query