how to group by linq base on input parameter

by mhd.cs   Last Updated July 12, 2019 03:06 AM - source

hi i wanna use group by in c# and my result must be like this code in sql

                MAX(EffectiveDate) AS EffectiveDate,details.PersonnelBaseID
            dbo.tkp_PersonnelDetails AS details 
            where details.EffectiveDate <= @Time
        GROUP BY PersonnelBaseID

@Time is a input parameter: assume tkp_PersonnelDetails is a list of object in c#.

Tags : sql-server c# linq

Related Questions

Splitting rows into columns with group by clause

Updated December 12, 2016 08:02 AM

Can't get data from stored procedure

Updated July 19, 2018 14:06 PM

Linq Query Optimization

Updated July 27, 2015 13:02 PM

how to use left join in LINQ

Updated August 13, 2018 15:06 PM