c# - Lambda expression with separate column values -
i trying a query work user input. new c# , lambdas sorry basic question have hit road block. getting address input user in separate fields, 5 separate fields exact.
if (!string.isnullorempty(sessionhandler.streetnumber)) { allfeatures = layerfindresults.querytools.getallfeatures(returningcolumnstype.allcolumns); searchresults = allfeatures.where(f => f.columnvalues["streetnum"].tolower().contains(sessionhandler.streetnumber.tolower()).select(f =>new { streetnum = f.columnvalues["streetnum"], streetname = f.columnvalues["str_name"] }).tolist()); }
this works getting values in streetnum
wondering if there way other values associated column value such street name without user inputting value them.
if unclear, sorry.
if there way other values associated
the select
friend. select creates projection meaning 1 changing 1 form of data another. want create dynamic entity using select
extract related/needed data such here returns city well:
searchresults = allfeatures.where( ... ) .where( ... ) // behaves `and` between 2 where's. .select(f => new { street = f.columnvalues["streetnum"], city = f.columnvalues["city"] }) .tolist();
Comments
Post a Comment