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
Post a Comment