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 Query
- 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
More Query from same tag
- Lambda expression not correct - need to return a boolean Func
- LINQ to SQL - Save an entity without creating a new DataContext?
- LINQ Group by with sort
- Linq-ing Calculated Properties in nhibernate could not resolve property Error
- getting nested results from linq to sql
- get last element with linq to sql
- Which model is the fastest using linq, foreign key relationships or local lists?
- Convert my already created application and database to support multiple sites on single db
- How to do convert the following ino lambda expression(method syntax)?
- Get weekday range from two dates
- Expose a repository as an IQueryable
- Sometimes when modifying properties in a foreach loop, the changes do not remain
- Is there any extension method which get void returning lambda expression ?
- How can i order by Current Date in Linq/Sql?
- Dynamic LINQ to DataTable: why using hardcode string "it" as DataRow
- Comparing Enumerable with enumerable in a linq query
- C# XDocument remove attributes not in a list
- C# how to filter a list by different properties at runtime
- KeyPairValue Linq
- Linq Expression throws InvalidOperationException
- Normalize xml data to object linq to xml
- Filtering List Objects Based on Property String
- Linq filtering a list by a composite key (contains and not contains)
- Performing a sum subquery using linq
- C# - Return generic type as IEnumerable
- I need to make linq to run depending on the value is floating point or not
- Linq equivalent of sql statement from one table but including counts based on groups within that table
- LINQ command for data reduction of GPS data
- Using linq with PropertyValueCollection
- How to join linq in c#?