Hi
I need a quick modification of my query to get upcoming birthdays. Currently I get them but shows passed birthdays of current month.
- var day = DateTime.Today;
- // var currentDay = DateTime.Now.Day;
- var month = day.AddMonths(3);
- var note = (from cn in _peopleRepository.GetAll()
- where cn.PeopleTypeId == 3
- && cn.BirthDate.Value.Month >= day.Month && cn.BirthDate.Value.Month <= month.Month
- orderby cn.BirthDate.Value.Month, cn.BirthDate.Value.Day
- select new GetLandlordBirthdayOutput
- {
- Id = cn.Id,
- FirstName = cn.FirstName,
- LastSurname = cn.LastName,
- Province = cn.Province,
- City = cn.City,
- Suburb = cn.Suburb,
- Email = cn.EmailAddress,
- Phone = cn.CellNumber,
- Birthday = cn.BirthDate
- }).ToList();

Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 24, 2017, 5:11 AM EDT
Let me know if you have other queries
Anele NgqanduRank #3,763 · 393 reputationPosted Apr 24, 2017, 5:31 AM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 24, 2017, 5:45 AM EDT
Anele NgqanduRank #3,763 · 393 reputationPosted Apr 24, 2017, 5:59 AM EDT