Пример #1
0
 public MajorViewModel GetMajors()
 {
     return(new MajorViewModel()
     {
         majors = _majorRepository.GetMajors()
     });
 }
Пример #2
0
        public IActionResult Index()
        {
            var majors = new List <ViewMajor>();

            majors = majorRepository.GetMajors().ToList();
            return(View(majors));
        }
Пример #3
0
        public async Task <QueryResultResource <MajorResource> > GetMajors(QueryResource queryResource)
        {
            var query = mapper.Map <QueryResource, Query>(queryResource);

            var queryResult = await repository.GetMajors(query);

            return(mapper.Map <QueryResult <Major>, QueryResultResource <MajorResource> >(queryResult));
        }