예제 #1
0
        public void MaxBatchSize_is_optional()
        {
            var factory = new SqlServerModificationCommandBatchFactory(new SqlServerSqlGenerator());
            IDbContextOptions options = new DbContextOptions();

            options.RawOptions = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            options.AddExtension(new SqlServerOptionsExtension());

            var batch = factory.Create(options);

            Assert.True(factory.AddCommand(batch, new ModificationCommand(new SchemaQualifiedName("T1"), new ParameterNameGenerator(), p => p.SqlServer())));
            Assert.True(factory.AddCommand(batch, new ModificationCommand(new SchemaQualifiedName("T1"), new ParameterNameGenerator(), p => p.SqlServer())));
        }
예제 #2
0
        protected virtual DbContextOptions CreateHistoryContextOptions()
        {
            IDbContextOptions contextOptions = new DbContextOptions().UseModel(HistoryModel);

            // TODO: Figure out whether it is ok to reuse all the extensions
            // from the user context configuration for the history context.
            foreach (var item in _options.Service.Extensions)
            {
                var extension = item;
                contextOptions.AddExtension(extension);
            }

            return((DbContextOptions)contextOptions);
        }