Hello I have a Class Called EmpowerCalendarCode:
It has the following fields CalendarCode, CalendarName, EffectiveStartDate, EmpowerTaxType, LongAgencyCode, TaxDepositFrequencyBaseTypeID.
I want to filter this list based on LongAgenyCode and EmpowerTaxType. So lets say:
public IList<EmpowerCalendarCode> GetEmpowerCalendarCodes(string longAgencyCode, string EmpowerTaxType)
{
//todo:
}
If I get more than one EmpowerCalendarCode for same longAgencyCode, EmpowerTaxType which has the same TaxDepositFrequencyBaseTypeID , then I should pick the one which has the most recent EffectiveStartDate. How ould be able to write a LINQ query. I am okay even if we have to do two three queries to get the result.
Any Ideas and suggestions are appreciated!
Try this: