示例#1
0
        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));
        }
示例#2
0
        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));
        }