now,i use EF core to search database,with this code
.Select(i => new { id = "" + i.OrganID, name = i.OrganName + "_" + i.LeaderMobile })
the column named LeaderMobile is nullable, nvarchar(100) null
.
when OrganName
is not null and LeaderMobile
is null, the result is null.
excample:
OrganName="aaa" LeaderMobile =null
The result is null, but I want the result is "aaa_" ( in EF ,it does work)
How can i do without change this code. well, I mean where i can config to make it work.
Not like:
.Select(i => new { id = "" + i.OrganID, name = i.OrganName + "_" + (i.LeaderMobile ?? "") })
set
ofLeaderMobile
and assign empty string if this member isnull
.