public string SearchByAuthor(string _author) { var item = BookList.FirstOrDefault(o => o.Author == _author); if (item != null) { string bookDetails; bookDetails = String.Format("BOOK FOUND WITH AUTHOR " + _author + ": Book Name: {0}, Book Author: {1}, Book Publisher: {2}", item.Title, item.Author, item.Publisher); return(bookDetails); } else { return("No book found"); } }
bool IsBookExist(string name) { return(BookList.FirstOrDefault(b => b.Name == name) != null); }