So I know there is a lot of questions asked on this same exact question, and there are a lot of great answers but still I can't seem to fix my own problem with my code. So I will GREATLY appreciate anything anyone has to offer. I really feel like I have tried everything and I just have no idea what the problem may be. I have been working on this forever. I want to Read from the List and write it to the Console. But When I try to write it it is blank.
public class Admin
{
public void Maine()
{
List<Books> myLibraryBooks = new List<Books>();
Books book1 = new Books();
Console.Write("Enter Author Name:");
book1.Author = Console.ReadLine();
Console.Write("Enter Book Title:");
book1.Title = Console.ReadLine();
Console.Write("Enter Book ISBN:");
book1.ISBN = Console.ReadLine();
Console.Write("Enter the Publish Date:");
book1.Publish_Date = Console.ReadLine();
myLibraryBooks.Add(new Books() { Author = book1.Author.ToUpper(), Title = book1.Title.ToUpper(), ISBN = book1.ISBN, Publish_Date = book1.Publish_Date.ToUpper() });
Console.WriteLine("Book added Successfully");
Console.Write("Enter Author's Name:");
string input_to_find = Console.ReadLine();
var author = from Authors in myLibraryBooks
where Authors.Author == input_to_find
select Authors;
foreach (var book in author)
{
Console.WriteLine(book.Author, book.Title, book.ISBN, book.Publish_Date);
}
class Books
{
public string Author { get; set; }
public string Title { get; set; }
public string ISBN { get; set; }
public string Publish_Date { get; set; }
}