Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Options.ConnectionOptions connectionOptions = new Options.ConnectionOptions();

            DataAccessLayer dataAccessLayer = new DataAccessLayer(connectionOptions);

            Console.WriteLine("Hello World!");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public DataAccessLayer(Options.ConnectionOptions options)
        {
            string connectionStr = $"Data Source={options.DataSource};"
                                   + $" Database={options.DataBase}; "
                                   + $"Integrated Security={options.IntegratedSecurity};"
                                   + $"Pooling={options.Pooling}";


            using (TransactionScope scope = new TransactionScope())
            {
                connection = new SqlConnection(connectionStr);

                connection.Open();


                scope.Complete();
            }
        }