예제 #1
0
        /// <summary>
        /// Creates the book action.
        /// </summary>
        /// <param name="selfHosted">if set to <c>true</c> a null action is returned, otherwise a AddAndDisplayBooksAction.</param>
        /// <returns>the newly created action.</returns>
        private static IBookAction CreateBookAction(bool selfHosted)
        {
            if (selfHosted)
            {
                return new NullBookAction();
            }

            var bookStoreEntities =
                new BookStore.BookStoreEntities(new Uri("http://localhost:51423/DataSevice/BookStoreDataService.svc"));
            return new AddAndDisplayBooksAction(bookStoreEntities);
        }
        /// <summary>
        /// Creates the book action.
        /// </summary>
        /// <param name="selfHosted">if set to <c>true</c> a null action is returned, otherwise a AddAndDisplayBooksAction.</param>
        /// <returns>the newly created action.</returns>
        private static IBookAction CreateBookAction(bool selfHosted)
        {
            if (selfHosted)
            {
                return(new NullBookAction());
            }

            var bookStoreEntities =
                new BookStore.BookStoreEntities(new Uri("http://localhost:51423/DataSevice/BookStoreDataService.svc"));

            return(new AddAndDisplayBooksAction(bookStoreEntities));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AddAndDisplayBooksAction"/> class.
 /// </summary>
 /// <param name="bookStoreEntities">The book store entities.</param>
 public AddAndDisplayBooksAction(BookStoreEntities bookStoreEntities)
 {
     this.bookStoreEntities = bookStoreEntities;
     this.randomNumberGenerator = new Random();
 }