how to group by linq base on input parameter

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

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

SELECT
                MAX(EffectiveDate) AS EffectiveDate,details.PersonnelBaseID
        FROM            
            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


Updated December 12, 2016 08:02 AM

Updated July 19, 2018 14:06 PM

Updated July 27, 2015 13:02 PM

Updated August 13, 2018 15:06 PM