public void MysqlFindByID() { //mysql FindByID MyDapperPower.DbConnection("server=localhost;port=3306;user id=root;password=Aa82078542;database=testmysql;SslMode=none", "mysql", "mysql"); UserLocalDAL userLocalDAL = new UserLocalDAL(); var result = userLocalDAL.FindByID(2); }
public void MysqlFindByIDTra() { MyDapperPower.DbConnection("server=localhost;port=3306;user id=root;password=Aa82078542;database=testmysql;SslMode=none", "mysql", "mysql"); UserLocalDAL userLocalDAL = new UserLocalDAL(); using (var transactionScope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { using (var connection = userLocalDAL.Connection) { var result = userLocalDAL.FindByID(connection, 2); } } }