Exemplo n.º 1
0
        public DapperClient CreateClient(string dbkey)
        {
            if (dbkey == null)
            {
                throw new ArgumentNullException(nameof(dbkey));
            }

            var client = new DapperClient(new ConnectionProvider {
            });

            var option = _optionsMonitor.Get(dbkey).DapperActions.FirstOrDefault();

            if (option != null)
            {
                option(client.CurrentConnectionConfig);
            }
            else
            {
                throw new ArgumentNullException(nameof(option));
            }

            return(client);
        }
Exemplo n.º 2
0
 public DBAccess(IDapperFactory dapperFactory)
 {
     _SqlDB = dapperFactory.CreateClient(dapperFactory.DBKey);
 }
Exemplo n.º 3
0
 public DTService(IDapperFactory dapperFactory)
 {
     _SqlDB = dapperFactory.CreateClient(dapperFactory.DBKey);
 }