Example #1
0
        public static UserInputBook CreateBook(string title, UserInputAuthor author)
        {
            if (string.IsNullOrEmpty(title))
            {
                throw new ArgumentException("The title cannot be null or empty", nameof(title));
            }

            if (author == null)        /* Wasn't exactly sure what was going on here.*/
            {
            }

            return(new UserInputBook(title, author));
        }
Example #2
0
        private static void AddBook()
        {
            Console.WriteLine("Add a book to your library"); //I need some help here too. I'm kind of new to working with classes and such.
            DrawStarLine();
            Console.WriteLine("What is the Title of the book?");
            Console.WriteLine("What is the author's name?");
            UserInputAuthor author = UserInputAuthor.CreateAuthor("", "");
            // ask for the book name
            UserInputBook book = UserInputBook.CreateBook("", author);

            // Store in Database

            ////using (IDbConnection connection = new SqlConnection(""))
            ////using (IDbCommand command = connection.CreateCommand())
            ////{
            ////}

            Console.ReadLine();
            Environment.Exit(0);
        }
Example #3
0
 protected UserInputBook(string title, UserInputAuthor author)
 {
     Title = title;
 }