Question: I read some questions here but they all can be defined as separate variables but I think mine is little bit different:

```
  var sliderRecordList = this._sliderService.GetAllAsQueryable();      
  var sliderModelList = sliderRecordList.Select(record => new SliderModel()
      {
        Id = record.Id,
        SlideName = record.SlideName,
        SlideOrder = record.SlideOrder,
        SlideUrl = record.SlideUrl,
        SlideImageUrl = Url.Content("~/Content/AhsenSliderImages/" + record.Id + ".jpg"),
        Enabled = record.Enabled
   });

```

The problem relies on where `Url.Content()` method is called. Any suggestion? I tried to remove `Url.Content()` method and didn't work.

Answer: 
Materalize the query first, then setup the UI concerns.

```
var sliderRecordList = this._sliderService.GetAllAsQueryable().ToList();
var sliderModelList = sliderRecordList
   .Select(record => new SliderModel
      {
        Id = record.Id,
        SlideName = record.SlideName,
        SlideOrder = record.SlideOrder,
        SlideUrl = record.SlideUrl,
        SlideImageUrl = Url.Content("~/Content/AhsenSliderImages/" + record.Id + ".jpg"),
        Enabled = record.Enabled
   });

```

`.ToList()` will execute the query first.

On a side note, consider using [AutoMapper](http://automapper.codeplex.com/) to turn the above code into just a couple of lines:

```
var sliderRecordList = this._sliderService.GetAllAsQueryable().ToList();
var sliderModelList = Mapper.Map<ICollection<SliderRecord>, ICollection<SliderModel>>(sliderRecordList);

```

URL generation can be done in the View.
This is because the function `Url.Content` can not translated to its SQL equivalent function. Use `AsEnumerable` function to the list and give it a try

```
var sliderModelList = sliderRecordList.AsEnumerable.Select(record => new SliderModel()
      {
        Id = record.Id,
        SlideName = record.SlideName,
        SlideOrder = record.SlideOrder,
        SlideUrl = record.SlideUrl,
        SlideImageUrl = Url.Content("~/Content/AhsenSliderImages/" + record.Id + ".jpg"),
        Enabled = record.Enabled
   });

```

Good luck.