You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
EntityFrameworkCore.Jet/test/EFCore.Jet.FunctionalTests/TestUtilities/JetDbContextOptionsBuilderE...

26 lines
915 B
C#

// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using EntityFrameworkCore.Jet.Infrastructure;
using Microsoft.EntityFrameworkCore.Infrastructure;
namespace EntityFrameworkCore.Jet.FunctionalTests.TestUtilities
{
public static class JetDbContextOptionsBuilderExtensions
{
public static JetDbContextOptionsBuilder ApplyConfiguration(this JetDbContextOptionsBuilder optionsBuilder)
{
var maxBatch = TestEnvironment.GetInt(nameof(JetDbContextOptionsBuilder.MaxBatchSize));
if (maxBatch.HasValue)
{
optionsBuilder.MaxBatchSize(maxBatch.Value);
}
optionsBuilder.ExecutionStrategy(d => new TestJetRetryingExecutionStrategy(d));
optionsBuilder.CommandTimeout(JetTestStore.CommandTimeout);
return optionsBuilder;
}
}
}