I'm trying to do the following:
from c in db.GetAllContactsQuery()
select new
{
ID= c.ID,
LastName = c.LastName,
FirstName = c.FirstName,
Email = c.Email,
City =c.City+" "+c.State
}
The issue i'm running into is that if c.City or c.State are null, the City property returns null. How can I put a function right beside that City=
declaration?
I'd really like to know if its possible to do something like this (this does not work):
from c in db.GetAllContactsQuery()
select new
{
ID= c.ID,
LastName = c.LastName,
FirstName = c.FirstName,
Email = c.Email,
City ={ c=>
//completely sweet function in here
if(String.IsNullOrEmpty(c.City))
return "booyah";
}
}