public async Task <ActionResult> GetSectionList()
        {
            SectionListView       model    = new SectionListView();
            IEnumerable <Section> sections = await _sectionRepository.GetAllRecords();

            Section[] section = (await _sectionRepository.GetDataRocordsAsync(1, sections.Count(), 0, SortDirection.Ascending, string.Empty)).ToArray();
            model.ListSections = section;

            return(PartialView("GetSection", model));
        }
示例#2
0
        public static SectionListView ToListView(this Section section)
        {
            if (section == null)
            {
                return(null);
            }

            var listView = new SectionListView
            {
                Id                 = section.Id,
                Title              = section.Title,
                Difficulty         = section.Difficulty,
                Length             = section.Length,
                TopPerformances    = null,
                UserTopPerformance = null
            };

            return(listView);
        }
 public SectionController(IRepository<Section> repo)
 {
     sectionRepository = repo;
     sectionListView = new SectionListView(sectionRepository);
 }