public async Task <IActionResult> GetWatchNext() { var record = await _watchNextReader.GetActiveWatchNext(_currentUserAccessor.CurrentUser.Id); if (record == null) { return(NotFound()); } return(Ok(FilmResponse.FromRecord(record))); }
public async Task <IActionResult> GetFilm([FromRoute] long id) { var record = await _filmReader.GetFilmById(id); if (record == null) { return(NotFound()); } return(Ok(FilmResponse.FromRecord(record))); }
public async Task <IActionResult> GetWatchedFilms(int page = 1, int pageSize = 5) { var count = await _filmReader.GetWatchedFilmCount(_currentUserAccessor.CurrentUser.Id); var records = await _filmReader.GetWatched(_currentUserAccessor.CurrentUser.Id, pageSize, (page - 1) *pageSize); return(Ok(PagedResponse <FilmResponse> .FromEnumerable(records, record => FilmResponse.FromRecord(record), page, pageSize, count))); }