Exemplo n.º 1
0
        /// <inheritdocs />
        public async Task <Exceptional <IList <BoardGame> > > FindAsync(IList <string> ids)
        {
            try
            {
                var url      = _apiProvider.BuildUri(ApiEndPoint.BoardGame, string.Join(",", ids), _whereQueries);
                var rootList = await _apiProvider
                               .CallWebServiceGetAsync <BoardGameListDto>(url)
                               .ConfigureAwait(false);

                var result = rootList?.BoardGames
                             .Select(x => _modelFactory.CreateBoardGame(x))
                             .ToList();

                return(Exceptional <IList <BoardGame> > .Success(result));
            }
            catch (Exception ex)
            {
                return(Exceptional <IList <BoardGame> > .Failure(ex));
            }
        }