score:1
var temp = ctx.books
// probably some where clause
.select(x => new
{
bookid = x.bookid,
bookname = x.title,
authors = x.authorbooks.select(a => a.author)
})
.toarray();
var books = temp.select(x => new {
x.bookid,
x.bookname,
authors = x.authors.aggregate(new stringbuilder(), (sb, r) => sb.append(r.firstname + " " + r.lastname +"& "), sb => sb.tostring())
});
Source: stackoverflow.com
Related Query
- Linq to SQL added a Lambda .Join geting AnonymousType#1' does not contain a definition and no extension method
- Aggregate Extension Method Not Supported (Linq to Sql)
- LinqPad Linq Include() extension method is not found even after adding references
- Error, method not supported by LINQ to Entities
- encapsulating logic in a linq to sql query via extension method
- Add a LINQ or DBContext extension method to get an element if not exist then create with data in predicate (FirstOrCreate)
- LINQ error - The method 'Sum' is not supported
- Linq to SQL Where Extension Method Question
- SQL equivalent of Count extension method for LINQ isn't obvious
- LINQ to Entities Method Not Recognized - Extension Method Style
- Nhibernate linq. The where extension method does not add the where clause to the SQL command, why?
- LINQ to Entities: queryable extension method not reconized inside where condition
- Outer Join is not working in Linq Query: The method 'Join' cannot follow the method 'SelectMany' or is not supported
- Errors translating Linq expression to URI: The method 'Select' is not supported
- The method AsQueryable is not supported in the expression tree mongodb linq
- Method 'SingleOrDefault' not supported by Linq to Entities
- Error "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities" in where clause inside the method
- 'TimeOfDay' is not supported in LINQ to Entities - Find total seconds in Linq 2 SQL
- Extension method & LINQ to Entities does not recognize the method error
- Linq extension method select not in
- Linq in conjunction with custom generic extension method build error - An expression tree may not contain an assignment operator?
- LINQ to Entities does not recognize the method in Aggregate
- Extension method (like Take()) not available for the LINQ query, Any reason why?
- Linq to SQL Extension Method: Method overloading, error
- Method has no supported translation in SQL in Linq
- Custom extension method to simplify LINQ to SQL statement
- NHibernate LINQ query Specified method is not supported error
- translate sql to linq extension method inner join with select group by
- Specified method is not supported when using Count() in Linq with Nhibernate
- Method not supported in LINQ Store expression
More Query from same tag
- Is there a way to create collection of objects from another in Java (LINQ-like)?
- Linq Select list of dynamic properties into another Object?
- How to use a conditional or in linq and C#
- How to return values from a LINQ query and display them in a table using C#, ASP.NET MVC and Entity Framework
- ordering based on count of values in column when getting distinct values
- To compare Date and Datetime in ASP.NET mvc 3?
- Dynamically Instantiate Model object in Entity Framework DB first by passing type as parameter
- LINQ to XML Query not working as desired
- Sum * Columns Where Date Between
- Parse html table using LINQ and HtmlAgilityPack
- Entity Framework Core: using navigation properties instead of joins
- available options for 'fake' linq comprehension syntax keywordsin C#?
- Finding objects in a collection that have any string from a list in a subcollection
- Reading Text Files with LINQ
- Convert EntityModel to DTO Using "Basic" Custom Method
- Parallel pattern for testing several items and possibly bailing
- linq query to fetch data by employee wise
- Object does not contain "fullname" LINQ error
- Can't seem to intellisense an entity (entity data framework)
- how to bind data to dropdown (data comes from a linq query) using jquery?
- Linq Min in Select new & Multiple GroupBy columns
- How to use LINQ to search and item from the database
- LINQ Join List of List
- How to get a Left Join on Linq
- LINQ indexOf a particular entry
- Entity Framework 4.1 Link table query how to?
- Linq to work with slightly complex selectlist
- LEFT JOIN in LINQ to entities?
- LINQ - Speeding up query that has a join to a huge table
- Using Linq to EF to search using a array as search parameter