예제 #1
0
        public IActionResult Get(int page, int pageSize)
        {
            var result = showRepository.Get(page, pageSize);

            var shows = mapper.Map <IEnumerable <ShowModel> >(result);

            foreach (var show in shows)
            {
                show.Cast = show.Cast.OrderByDescending(s => s.DateOfBirth);
            }

            return(Ok(shows));
        }
예제 #2
0
        public async Task EditTest()
        {
            Show value = await _repository.Get(TestSample.Get <Show>().Slug);

            value.Path  = "/super";
            value.Title = "New Title";
            Show edited = await _repository.Edit(value, false);

            KAssert.DeepEqual(value, edited);

            await using DatabaseContext database = Repositories.Context.New();
            Show show = await database.Shows.FirstAsync();

            KAssert.DeepEqual(show, value);
        }
예제 #3
0
 public IEnumerable <Show> GetShows(int pageNumber, int pageSize)
 {
     return(_showRepository.Get(pageNumber, pageSize));
 }