Esempio n. 1
0
        public UserController(IConfiguration Configuration)
        {
            string dbCon = Configuration.GetConnectionString("DefaultConnection");

            userStorage            = new UserStorage(dbCon);
            groupStorage           = new GroupStorage(dbCon);
            userAttestationStorage = new UserAttestationStorage(dbCon);
        }
Esempio n. 2
0
        public void CourseTest()
        {
            using IDbConnection connection = new SqlConnection(DBConnection.connString);
            connection.Open();
            IDbTransaction transaction = connection.BeginTransaction();

            UAStorage = new UserAttestationStorage(connection, transaction);

            try
            {
                Setup();
                TestSelects();
                TestUpdate();
                TestDelete(listAttestations);

                transaction.Commit();
            }
            catch
            {
                transaction.Rollback();
                throw new System.Exception();
            }
        }