public DataAccess(Model.DataManagerOptions.ConnectionOptions options)
        {
            config = new ConfigProvader();

            string connectionString = $"Data Source={options.DataSource};" +
                                      $" Initial catalog={options.InitialCatalog};" +
                                      $" User={options.User};" +
                                      $" Password={options.Password};" +
                                      $" Integrated Security={options.IntegratedSecurity}";

            using (var scope = new TransactionScope())
            {
                connection = new SqlConnection(connectionString);
                connection.Open();
                scope.Complete();
            }
        }
Exemple #2
0
 public ServiceLayerService(Model.DataManagerOptions.ConnectionOptions connectionOptions)
 {
     DAL = new DataAccess(connectionOptions);
 }