Exemplo n.º 1
0
        public DbContainer(DbContainerParameters parameters)
        {
            this.parameters = parameters;

            this.logger = new Logger();
            this.transformCache = new ConcurrentDictionary<string, IStoredProcedure>();
            this.converter = new DefaultTypeConverter();
        }
Exemplo n.º 2
0
        private DbContainer CreateDbContainer()
        {
            EffortConnectionStringBuilder connectionString =
                new EffortConnectionStringBuilder(this.ConnectionString);

            IDataLoader dataLoader = null;
            DbContainerParameters parameters = new DbContainerParameters();
            Type dataLoaderType = connectionString.DataLoaderType;

            if (dataLoaderType != null)
            {
                //// TODO: check parameterless constructor

                dataLoader = Activator.CreateInstance(dataLoaderType) as IDataLoader;
                dataLoader.Argument = connectionString.DataLoaderArgument;

                parameters.DataLoader = dataLoader;
            }

            parameters.IsTransient = this.isPrimaryTransient;

            return new DbContainer(parameters);
        }