コード例 #1
0
        public void Initializer()
        {
            scope = new TransactionScope();
            dao   = new BookSqlDAO(connectionString);
            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                conn.Open();

                SqlCommand cmd = new SqlCommand("INSERT book (title, authors, genre, shelf_number, add_date)" +
                                                "VALUES ('Star Wars', 'John Fulton', 'Test Genre', 2, '2018-08-14');", conn);
                cmd.ExecuteNonQuery();
            }
        }
コード例 #2
0
 public UserController(IUserSqlDAO userDAO, IBookSqlDAO bookDAO)
     : base(userDAO)
 {
     this.userDAO = userDAO;
     this.bookDAO = bookDAO;
 }
コード例 #3
0
 public HomeController(IBookSqlDAO bookDAO, IForumPostSqlDAO forumDAO, IUserSqlDAO userDAO) : base(userDAO)
 {
     this.forumDAO = forumDAO;
     this.bookDAO  = bookDAO;
     this.userDAO  = userDAO;
 }