var users=db.Users.Where(u => u.Name.StartsWith(term) || u.Email.StartsWith(term) || u.FirstName.StartsWith(term)).ToArray();
var jsos=users.Select(u => new { label = u.FirstName +" "+ u.Name+ " (" + u.Email+")", value = u.Id });
Works as expected. But, without the ToArray(), I get what appears to be strange behaviour: a null firstName results in the label being evaluated as null. With ToArray() I get the expected behaviour. (null is treated as an empty string and concatenated to the other non empty strings). Why?
In the SQL world, by definition, any expression that has NULL as part of it becomes NULL. This is because NULL means an indeterminate value – an indeterminate value + anything else is still an indeterminate value, i.e. NULL.
Again, in SQL you could use something like COALESCE to convert NULLs into, say, a blank string – I don’t recall off hand what the linq equivalent is.