If you want to get the whole Posts. You can try this:
var query = Posts.GroupBy(p => p.Type)
.Select(g => g.OrderByDescending(p => p.Date)
.FirstOrDefault()
)
More Related Contents:
- Linq: help me to make this work
- Dynamic where clause (OR) in Linq to Entities
- How do I apply OrderBy on an IQueryable using a string column name within a generic extension method?
- Bulk-deleting in LINQ to Entities
- Writing Recursive CTE using Entity Framework Fluent syntax or Inline syntax
- The type of one of the expressions in the join clause is incorrect in Entity Framework
- Entity framework left join
- Why doesn’t Include have any effect?
- LEFT JOIN in LINQ to entities?
- Linq to EntityFramework DateTime
- LINQ to SQL multiple tables left outer join
- Entity Framework (.NET Full Framework) Ordering Includes [duplicate]
- How to compare only date components from DateTime in EF?
- How to Bulk Update records in Entity Framework?
- Entity Framework 6 Code First Custom Functions
- Entity Framework. Delete all rows in table
- “The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities” – stumped!
- LINQ to Entities does not recognize the method ‘System.Web.Mvc.FileResult’
- Order by dynamic parameter
- LINQ, Unable to create a constant value of type XXX. Only primitive types or enumeration types are supported in this context
- Linq Syntax – Selecting multiple columns
- Linq to Entity Join table with multiple OR conditions
- Export Model to DataTable
- ‘Date’ is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported
- Log Queries executed by Entity Framework DbContext
- Check if list contains item from other list in EntityFramework
- How to do an “in” query in entity framework?
- Keep Getting ‘The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities’ Exception
- Should the order of LINQ query clauses affect Entity Framework performance?
- How to wrap Entity Framework to intercept the LINQ expression just before execution?