static void RemoveBook() { using (var context = new BookContext()) { Console.WriteLine("Enter Id of books for remove, please: "); var input = Console.ReadLine(); if (Guid.TryParse(input, out Guid bookId)) { if (context.RemoveById(bookId) != null) { Console.WriteLine("Book removed success!"); } else { Console.WriteLine("Can't find any book with this id!"); } } else { Console.WriteLine("Invalid input!"); } Console.ReadLine(); } }