public TestController( ILogger loggerParam, ISqlConfiguration configParam, IDapperClient dapperClientParam) { this.logger = loggerParam ?? throw new ArgumentNullException(nameof(loggerParam)); this.config = configParam ?? throw new ArgumentNullException(nameof(configParam)); this.dapperClient = dapperClientParam ?? throw new ArgumentNullException(nameof(dapperClientParam)); }
public DapperClient( ISqlConfiguration configParam, ILogger loggerParam) { var config = configParam ?? throw new ArgumentNullException(nameof(configParam)); this.logger = loggerParam ?? throw new ArgumentNullException(nameof(loggerParam)); var connectionString = $"Server={ config.Server };" + $"Initial Catalog={ config.InitialCatalog };" + $"Integrated Security={ config.IntegratedSecurity };" + $"MultipleActiveResultSets={ config.MultipleActiveResultSets };"; this.logger.Verbose($"Setting up DB Connection with connection string: { connectionString }"); this.connection = new SqlConnection(connectionString); }
public SqlRepository(ISqlConfiguration configuration) { _configuration = configuration; }
public OrderRepository(ISqlConfiguration sqlConfiguration) { _sqlConfiguration = sqlConfiguration; }
public SqlRepository(ISqlConfiguration sqlConfiguration) { _sqlConfiguration = sqlConfiguration; _dbConnection = new SqlConnection(_sqlConfiguration.ConnectionString); }