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)); }
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); }
public IEnumerable <Show> GetShows(int pageNumber, int pageSize) { return(_showRepository.Get(pageNumber, pageSize)); }