Esempio n. 1
0
        public async Task <IActionResult> GetAuthorCollection(
            [FromRoute]
            [ModelBinder(BinderType = typeof(ArrayModelBinder))]
            IEnumerable <Guid> authorIds)
        {
            if (authorIds == null)
            {
                return(BadRequest());
            }
            var authors = await _courseLibraryRepository.GetAuthorsWithIdsAsync(authorIds);

            var authorsDto = _mapper.Map <IEnumerable <AuthorDto> >(authors);

            return(Ok(authorsDto));
        }