Not sure exactly what you want to do.
1. If you want display the first name even if last name is null
var info = (from r in spe.contacts select new
{
fullname = r.firstname + " " + (r.lastname != null) ? r.lastname : "";
});
return info;
(You can do the same for first name.
2. If you want to ignore null names
var info = (from r in spe.contacts select new
{
if ((r.firstname != null) && (r.lastname != null))
fullname = r.firstname + " " + r.lastname;
});
return info;