public Page GetPage(int number) { Page page; if (_pages.TryGetValue(number, out page) == false) { page = _bookStore.GetPage(number); _pages.Add(page.Number, page); } return(page); }
public Page GetPage(int number) { Page page = pages.FirstOrDefault(p => p.Number == number); if (page == null) { if (bookStore == null) { bookStore = new BookStore(); } page = bookStore.GetPage(number); pages.Add(page); } return(page); }
public Page GetPage(int number) { var page = _pages.FirstOrDefault(p => p.Number == number); if (page == null) { if (_bookStore == null) { _bookStore = new BookStore(); } page = _bookStore.GetPage(number); _pages.Add(page); } return(page); }