>Hi everybody,
>
>I'm just wondering if you think this is OK as is or should be changed?
>
>
>public IEnumerable<RsTsBlocks> GetBlocksInSection(int sectionId)
> {
> return _rsTsBlocksRepository.GetBlocksInSection(sectionId)
> .Cast<RsTsBlocks>()
> .Select(x => { x.CenterMost = x.CenterMost == "C" ? Labels.centerSeat : (x.CenterMost == "E" ? Labels.endSeat : Labels.startSeat);
> return x; })
> .ToList();
> }
>
>I have only 3 cases (C/S/E) and I want to return back the correct description translated. Does the above code look OK or should it be somehow changed?
>
>Thanks in advance.
For this to work at all, GetBlocksInsection should be returning local data (an IEnumerable and not an IQueryable). Other than that you are doing a transformation on a member. If this list wouldn't need to be saved or again a transformation made on save then it should be OK. Since this seems to be only for display purposes, I would personally do this on the UI instead.