Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[small] Fix migration dependencies #23975

Merged
1 commit merged into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ public static IServiceCollection AddDbContextDesignTimeServices(
.AddTransient(_ => context.GetService<IMigrator>())
.AddTransient(_ => context.GetService<IRelationalTypeMappingSource>())
.AddTransient(_ => context.GetService<IModel>())
.AddTransient(_ => context.GetService<IConventionSetBuilder>());
.AddTransient(_ => context.GetService<IModelRuntimeInitializer>());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Linq;
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Design.Internal;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Internal;
Expand Down Expand Up @@ -69,6 +71,17 @@ public void Updates_provider_annotations_on_model()
Assert.Empty(reporter.Messages);
}

[ConditionalFact]
public void Can_resolve_ISnapshotModelProcessor_from_DI()
{
var assembly = typeof(SnapshotModelProcessorTest).Assembly;
var snapshotModelProcessor = new DesignTimeServicesBuilder(assembly, assembly, new TestOperationReporter(), new string[0])
.Build(SqlServerTestHelpers.Instance.CreateContext())
.GetRequiredService<ISnapshotModelProcessor>();

Assert.NotNull(snapshotModelProcessor);
}

[ConditionalFact]
public void Warns_for_conflicting_annotations()
{
Expand Down