Does anyone know how to make a Linq query that gets all the birthdays of today? The code below doesn\'t work :
var getBirthdays = orgContext.CreateQuery<
If c.BirthDate is nullable, you have to convert it to a datetime first:
var getBirthdays = orgContext.CreateQuery() .Where(c => c.BirthDate != null && (Convert.ToDateTime(c.BirthDate).Month == DateTime.Now.Month) && Convert.ToDateTime(c.BirthDate).Day == DateTime.Now.Day)) .ToList();