I want to quickly select some lines, format them well for the / selectlist dropdown, or something like that, but I have a field in db that is null (DateOfBirth).
var athletes = (from at in _db.Athletes select new{ Name = at.Name + " " + at.DateOfBirth, Id = at.AthleteId }).ToList();
Is there a way to handle nullable types inside LINQ in this case?
Edit:
I did not pay attention to the fact that since it uses an entity structure, methods that work with standard LINQ cannot be used if they do not have SQL translation.
- DateOfBirth is a Nullable <DateTime>
- Source is Entity Framework 4
source share