Exemplo n.º 1
0
 public SqlServerCommandBatchPreparer(
     [NotNull] SqlServerModificationCommandBatchFactory modificationCommandBatchFactory,
     [NotNull] ParameterNameGeneratorFactory parameterNameGeneratorFactory,
     [NotNull] ModificationCommandComparer modificationCommandComparer)
     : base(modificationCommandBatchFactory, parameterNameGeneratorFactory, modificationCommandComparer)
 {
 }
Exemplo n.º 2
0
 public SqlServerCommandBatchPreparer(
     [NotNull] SqlServerModificationCommandBatchFactory modificationCommandBatchFactory,
     [NotNull] ParameterNameGeneratorFactory parameterNameGeneratorFactory,
     [NotNull] ModificationCommandComparer modificationCommandComparer,
     [NotNull] IBoxedValueReaderSource boxedValueReaderSource)
     : base(modificationCommandBatchFactory, parameterNameGeneratorFactory, modificationCommandComparer, boxedValueReaderSource)
 {
 }
        public void SqlServerOptionsExtension_is_optional()
        {
            var factory = new SqlServerModificationCommandBatchFactory(new SqlServerSqlGenerator());

            var optionsBuilder = new EntityOptionsBuilder();
            optionsBuilder.UseSqlServer("Database=Crunchie");

            var batch = factory.Create(optionsBuilder.Options, new SqlServerMetadataExtensionProvider());

            Assert.True(factory.AddCommand(batch, new ModificationCommand("T1", null, new ParameterNameGenerator(), p => p.SqlServer(), new UntypedValueBufferFactoryFactory())));
            Assert.True(factory.AddCommand(batch, new ModificationCommand("T1", null, new ParameterNameGenerator(), p => p.SqlServer(), new UntypedValueBufferFactoryFactory())));
        }
        public void SqlServerOptionsExtension_is_optional()
        {
            var factory = new SqlServerModificationCommandBatchFactory(new SqlServerSqlGenerator());

            var optionsBuilder = new DbContextOptionsBuilder();
            optionsBuilder.UseSqlServer("Database=Crunchie");

            var batch = factory.Create(optionsBuilder.Options);

            Assert.True(factory.AddCommand(batch, new ModificationCommand("T1", null, new ParameterNameGenerator(), p => p.SqlServer(), new BoxedValueReaderSource())));
            Assert.True(factory.AddCommand(batch, new ModificationCommand("T1", null, new ParameterNameGenerator(), p => p.SqlServer(), new BoxedValueReaderSource())));
        }