I have the following linq query:
public static int GetContributions(PERSON person, DateTime startDate, DateTime endDate)
{
using (var db = new TestEntities())
{
var creditsSum = (from u in db.PERSON_SOCIAL_INSURANCE_CONTRIBUTIONS
where u.StartDate >= startDate
where u.EndDate <= endDate
where (u.PersonId == person.Id)
select (int?)u.NumOfContributions).Sum() ?? 0;
return creditsSum;
}
}
I would like to create a similar method that returns the number of contributions that do not fall between the start and end date provided. So basically for it to return all entries that do not fall between startDate and endDate values.
Any help?