Ejemplo n.º 1
0
            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");
                }
            }
Ejemplo n.º 2
0
 bool IsBookExist(string name)
 {
     return(BookList.FirstOrDefault(b => b.Name == name) != null);
 }