score:1
Accepted answer
i think it will be easier using method based query:
var result = context.block.select(b => b.events.select(e => new
{
e.eventid,
e.date,
e.deviceid,
e.blockid,
e.accelleration,
e.intensity
}).tolist()).tolist();
score:1
you need to use a groupjoin
here is an example
var teamsandriders = teams.groupjoin(riders, team => team.name, rider => rider.teamname, (team, teamriders) => new {team = team.name, riders = teamriders.select(rider => rider.name)});
Source: stackoverflow.com
Related Query
- What kind of query in LINQ do I have to make to get a custom List that contains Lists of objects?
- Cannot get more than one result when using System.Linq.Dynamic.Core to query a list of objects that have a member dictionary
- c# Linq - Get all elements that contains a list of integers
- I have 2 Lists of strings. How do I get a bool that tells me if one lists contains atleast one string from the other list ? (Using Lambda)
- What SQL query or LINQ code would get the following data?
- Using Linq to create a collection of a custom class from a DbSet that contains a list of grouped entities
- Problem with a Linq to Entity query that contains a passed list of entities
- Get elements of list that contains element of other list LINQ
- Use Linq to get Items in List that do not have a match in another list
- How to write Linq query to check whether List have that id
- Dynamic linq query that Contains ALL from another list
- use linq to get a sub list that contains elements from an array
- Linq query to get filtred main collection and each list in result in that collection
- Returning a custom list class type from LINQ Query - return same type going in that is coming out
- What is the Linq Query expression to get all the department Id , Name in a select list variable for drop down
- How to query with Linq a List that contains a list of lists that contains a list of lists that contains a list of objects?
- Check if list contains element that contains a string and get that element
- Linq query list contains a list
- Linq - How to select items from a list that contains only items of another list?
- Linq query to get the distinct values in a list
- Using LINQ to Get Sum/ Average of a List with custom objects
- Get first item in list from linq query
- What is the most impressive LINQ statement that you have come across?
- Dynamic Linq query Contains List
- Linq to entities - SQL Query - Where list contains object with 2 properties (or more)
- Using Linq to group a list of objects that contains primitives data into a new grouped list of objects
- LINQ query on an object list to get distribution based on multiple fields
- Linq return parent objects that have child items matching ALL items in separate list
- linq - how do you do a query for items in one query source that are not in another one?
- What is the LINQ query to get a Cartesian Product even when one set is EMPTY?
More Query from same tag
- Convert object[] into Lookup with Linq
- LINQ Conditional Where clause including multiple conditions
- Converting foreach to Linq
- Convert loop to LINQ
- Ordering Object and Selecting based on custom priority
- How can I use LINQ to match words
- What does Include() do in LINQ?
- Order by descending is not working on LINQ to Entity
- Entity Framework 5 upgrade from 4
- Using SQL Wildcards with LINQ
- VB.NET LINQ cannot convert result to dictionary
- XML not well formed after deleting node using LINQ
- LINQ Distinct with EqualityComparer<T>.Default: IEquatable<T> implementation ignored?
- Linq count on a secondary grouping criteria
- linqjs group by with a sum
- C# Specifying orderby in extension method
- How can I select items with Linq by Date while ignoring Time portion of a DateTime property?
- C# Ternary Operator used in LINQ query
- LINQ Entity Framework Select into a non-primary-key relationship
- Linq mapping between models
- LINQ and selection rows from big database
- Intersect two object lists on a common property and then compare a different property
- Left Join in VB.NET LINQ
- LINQ Get full list of objects, include only the properties that match certain condition
- Linq to Entities - Get list of all unique related entities
- Get Option set label in LINQ
- Creating Dynamic Fetch Expression
- Linq: adding conditions to the where clause conditionally
- multiple records with the same order id incremented from the previous MAX value
- How to join group item of Linq Query Group By?