Пример #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);
        }
Пример #2
0
 public DBAccess(IDapperFactory dapperFactory)
 {
     _SqlDB = dapperFactory.CreateClient(dapperFactory.DBKey);
 }
Пример #3
0
 public DTService(IDapperFactory dapperFactory)
 {
     _SqlDB = dapperFactory.CreateClient(dapperFactory.DBKey);
 }