public ActionResult Index() { var boCollection = _Service.GetAll().OrderBy(x => x.Name); var vmCollection = new List <ArtistDisplayViewModel>(); var count = 0; foreach (var item in boCollection) { var vm = new ArtistDisplayViewModel { ID = item.ID, Name = item.Name, Description = item.Description }; vm.OrderNumber = (++count).ToString(); vmCollection.Add(vm); } return(View(vmCollection)); }
public ActionResult Index() { var boCollection = _Service.GetAll().OrderBy(x => x.Name); var vmCollention = new List <ArtistDisplayViewModel>(); var count = 0; foreach (var item in boCollection) { ArtistDisplayViewModel vm = new ArtistDisplayViewModel { Id = item.Id, Name = item.Name, Description = item.Description, Tags = item.Tags, ViewCount = item.ViewCount, Collection = item.Collection }; vm.OrderNumber = (++count).ToString(); vmCollention.Add(vm); } ViewBag.Title = "歌手"; return(View(vmCollention)); }