c# - Combining several fields using Linq -


i'd combine several table fields in order produce combined value.

here's code:

from _showtime in db.tbl_concert_showtime join _concerthall in db.tbl_concert_concerthall on _showtime.concerthallid equals _concerthall.concerthallid                  join _hall in db.tbl_concert_hall on _concerthall.hallid equals _hall.hallid                  join _hallfloor in db.tbl_concert_hall_floor on _hall.hallid equals _hallfloor.hallid                  join _place in db.tbl_concert_hall_floor_place on _hallfloor.floorid equals _place.floorid                  _place.placeid == id                  select _showtime 

the showtime table includes showid, startdate, starttime , endtime fields.

how can select startdate , starttime in field?

something this: 2015/12/12 12:25 -> 12:58

from _showtime in db.tbl_blablabla     select _showtime.startdate + " " + _showtime.starttime + " -> " + _showtime.enddate 

if wanna keep original showtime object add combined value, follwoing:

from _showtime in db.tbl_blablabla     select new  {     showtime = _showtime,      combinedvalue = _showtime.startdate + " " + _showtime.starttime + " -> " + _showtime.enddate } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -