score:1
Accepted answer
The problem is that due to your outer joins, fork
and map
may be null. Of course when they're null, you can't access their properties. You may need something like this:
Status = (fork == null) ? null : fork.Status,
MapID = (map == null) ? null : map.ID
Source: stackoverflow.com
Related Articles
- LINQ to Entities - Multiple Joins - Null Reference Exception on 'Select'
- Null reference exception in my LINQ to XML code
- LINQ query with multiple joins throwing null reference error
- Null reference exception in linq select statement
- null reference exception with linq .where clause
- Strange null reference exception in LINQ query with EF
- How do you do Multiple Inner Joins in Linq to Entities
- Null reference exception being thrown in EF LINQ query if-clause
- Null Reference Exception in a Dynamic LINQ Expression
- Linq to SharePoint throwing null reference exception
- LINQ to Entities null reference on Union with nested objects
- I got a null reference exception on a Linq To SQL data context and I don't even really know where to start
- Foreign Key Reference Already Has Value Exception Linq to SQL When Assigning Null
- One context reference LINQ query throws multiple references exception - BUG?
- linq to entities if filter parameter is null then select all entities?
- LINQ Left join on nullable column giving null reference exception
- LINQ to Entities - Multiple Joins on Same Table
- Multiple cross reference table joins in linq
- How to convert Linq expression with multiple joins into method syntax OR retrieve select index?
- Get the max date from linq with mutiple joins and with multiple select fields
- Null reference exception in Linq
- Getting null reference Exception while parsing XML through LINQ
- Linq List.Select throws null reference exception but List.First doesn't
- Multiple Left OUTER OUTER joins in LINQ to Entities
- LINQ c# mvc4 null reference exception
- How can I select one of two objects depending if one is null or not with a LinQ to Entities query.
- Grouping datatable causing null reference exception in LINQ
- wrong value in result query so Null Reference Exception in Linq query
- LINQ to Dataset DBNULL problem / null reference exception
- LINQ select column(s) of table before doing multiple joins
- left join without explicit relationship in nhibernate 3.3.1.4000
- How to use LINQ to find all items in list which have the most members in another list?
- LINQ to Entities query for count and group by with join on 2 tables
- How to filter a list where I need multiple dynamic filter parameters
- C# Sum values in a List with multiple columns
- Add attributes to XML element based on the input
- Make properties of a class parameters to a function
- LINQ deferred (or immediate?) execution
- How to convert an IEnumerable<AnonymousType> to a List<T>?
- Using Linq to look for gap in dates
- How can I join multiple tables including a join-table (auto-generated by Entity Framework) using LINQ
- Lambda property value selector used in lambda expression
- LINQ: Use .Except() on collections of different types by making them convertible/comparable?
- method x has no supported translation to SQL when use a static class
- C# LINQ GroupBy with NULL values
- linq xml error handling
- Save data with foreign key or roll back if any fail
- how to do something like a "case when" condition in linq?
- Read xml data using XDocument class
- .NET LINQ Call Method with Out Parameters Within Query and use Out Values