score:0
return (from round in jsonModel.rounds
from match in round.matches
let goal = match.team1.key.Equals(teamKey) ? match.score1 : 0
select goal == 0 ? (match.team2.key.Equals(teamKey) ? match.score2 : 0) : goal).FirstOrDefault();
Source: stackoverflow.com
Related Query
- How to work with nested Arrays and Objects using LINQ
- How to create nested object graphs using Linq when the objects are immutable and reference their parent
- How to flatten nested objects with linq expression
- Using Distinct with LINQ and Objects
- How to update an element with a List using LINQ and C#
- Sort a list and all its nested objects using LINQ
- How to convert list of objects with two fields to array with one of them using LINQ
- How to create linq predicate with multiple nested "ands" and "ors"
- How to query many-to-many relationship with 'AND' condition using LINQ and Entity Framework
- Using linq with Sharepoint and disposing of objects
- How to get a complement list of objects using linq and EntityFramework
- How to get number of objects with common properties from context using LINQ
- How to parse XML header and nested sections using LINQ
- query and create objects with a one to many relationship using LINQ
- How to iterate wIth one loop or no loop in elegant way using LINQ / Divide and Conquer method
- How can I obtain objects from list with C# LINQ using boolean conditions?
- How to use Join, GroupBy and Average on C# Objects using LINQ
- Creating class objects using LINQ with a highly nested XML
- How to extend this LINQ List<>.Contains to work with any Property using Reflection?
- How to check if date_start1 and date_end1 overlaps with date_start2 and date_end2 using linq
- Using LINQ and Reflection: How to query for all Classes with [Authorize] Attribute in my Assembly?
- How to fill properties of objects using LINQ and return collection
- How to flatten nested objects with null leafs with linq expression
- How to query XML with the same element and attribute name using linq
- How to query values associated with the foreign key using linq and display in listview
- Using nested LINQ queries and collections of objects
- How to get nested chain of objects in Linq and MVC2 application?
- How to sort a List with LINQ using Nested Property
- How to filter object list with LINQ without using nested If statement
- how to execute a nested group aggregate functions with multi groupBy columns using entity framework and linq?
More Query from same tag
- dynamic linq multiple vs single .where query
- Remove items from list<a> AND list<b> when a.Foo == b.Bar
- Using LINQ to select a list of every item in a collection, except if it exists in another collection
- Using `System.String Concat` in `LINQ to Entities` generates `CAST`s instead of `CONCAT`
- How to write linq query comparing 2 tables?
- LINQ start and stop segments in list of List<T> elements
- How do I find the count of overlapping properties in SQL/LINQ query between two tables?
- How do you group items that have dependencies to other items in a collection?
- linq2db find string in varchar field
- AsQueryable() does not return needed type in custom LINQ query using Lightswitch
- LINQ statement value to ForEach C# WPF MVVM
- Issue altering XML file with XDocument
- How to use one C# expression inside another C# expression for Entity Framework?
- how to add XElement in specific location in XML Document
- Nullable Bit field true or false detection
- Linq or better approach to extract values from string[]
- Converting a lambda expression into a unique key for caching
- LINQ Query to put data in a nested object
- Get keys (objects) from a dictionary that contains list and filtered by values
- .Net Linq - Doing a operation on the subset
- Exclude multiple items from SelectList in mvc
- Best LINQ way to create dictionary from list of custom entities
- Select a table column from IEnumerable using Linq
- Object reference not set to an instance of an object model fk and virtual field
- Get first record of each entity order by a column
- How can I get my ajax request date format to match my database date format?
- Optimization in the SingleOrDefault function of Linq
- list compare and replace on matching condition linq C#
- LINQ Select Last & Unique Record from a DB using List
- Find (and extract) complex correllations to find rule violations