static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; BookstoreDAL dal = new BookstoreDAL(); XmlDocument xmlDoc = new XmlDocument(); //xmlDoc.Load("../../simple-query.xml"); xmlDoc.Load("../../../tests/5/test6.xml"); string xPathQuery = "/query"; using (var context = new BookstoreEntities()) { XmlNode query = xmlDoc.SelectSingleNode(xPathQuery); string title = GetChildText(query, "title"); string author = GetChildText(query, "author"); string ISBN = GetChildText(query, "isbn"); List<Book> foundBooks = dal.FindBooksByTitleAuthorAndISBN(context, dal, title, author, ISBN); int foundBooksCount = foundBooks.Count; if (foundBooksCount > 0) { Console.WriteLine("{0} books found:", foundBooks.Count); foreach (var book in foundBooks) { int numberOfReviews = dal.FindBookReviewCount(context, dal, book); if (numberOfReviews > 0) { Console.WriteLine("{0} --> {1} reviews", book.Title, numberOfReviews); } else { Console.WriteLine("{0} --> no reviews", book.Title); } } } else { Console.WriteLine("Nothing found"); } } }