/// <summary> /// Searches for an author by the authorname /// </summary> /// <param name="searchItem">Authorname to search for</param> /// <returns>The author with the given name.</returns> public Author CustomSearch(string searchItem) { if (authorRepo.All().Where(a => a.Name == searchItem).First() != null) { return(authorRepo.All().Where(a => a.Name == searchItem).First()); } else { throw new InputNotFoundException(); } }
/// <summary> /// Gets all the authors /// </summary> /// <returns>IEnumerable of all authors</returns> public IEnumerable <Author> All() { return(authorRepository.All()); }
/// <summary> /// Returns all authors ordered by their id /// </summary> /// <returns></returns> public IEnumerable <Author> All() { return(authorRepository.All().OrderBy(author => author.Name)); }