public ActionResult GetAuthors(Pagination pagination, AuthorFilter authorFilter, string orderBy = "Name") { var orderByEntities = OrderMapper.MapTo <Author>(orderBy); IPagedList <Author> authors = _libraryRepository.GetAuthors(pagination, authorFilter, orderByEntities); var authorDtos = _mapper.Map <IEnumerable <AuthorDto> >(authors); var result = new { meta = authors.GetMetaData(), value = authorDtos }; return(Ok(result)); }
public void MapToTest(string orderBy, string expected) { var mapTo = OrderMapper.MapTo <Author>(orderBy); Assert.Equal(expected, mapTo, true); }