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.
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using System;
|
|
using EntityFrameworkCore.Jet;
|
|
using Extensions.DependencyInjection;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace EntityFramework.Jet.FunctionalTests
|
|
{
|
|
public class MigrationsJetFixture : MigrationsFixtureBase
|
|
{
|
|
private readonly DbContextOptions _options;
|
|
private readonly IServiceProvider _serviceProvider;
|
|
|
|
public MigrationsJetFixture()
|
|
{
|
|
_serviceProvider = new ServiceCollection()
|
|
.AddEntityFrameworkJet()
|
|
.BuildServiceProvider();
|
|
|
|
var optionsBuilder = new DbContextOptionsBuilder();
|
|
optionsBuilder
|
|
.UseJet(ConnectionStringBuilderHelper.GetJetConnectionString(nameof(MigrationsJetTest)))
|
|
.UseInternalServiceProvider(_serviceProvider);
|
|
_options = optionsBuilder.Options;
|
|
}
|
|
|
|
public override MigrationsContext CreateContext() => new MigrationsContext(_options);
|
|
|
|
public override EmptyMigrationsContext CreateEmptyContext() => new EmptyMigrationsContext(_options);
|
|
}
|
|
}
|