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

Add a check to ShouldUseSameServiceProvider even when the extension has no options #26111

Merged
merged 1 commit into from
Sep 20, 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 @@ -446,7 +446,7 @@ public override int GetServiceProviderHashCode()
/// <param name="other"> The other extension. </param>
/// <returns> A value indicating whether all of the options that require a new service provider are the same. </returns>
public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
=> true;
=> other is RelationalExtensionInfo;

/// <summary>
/// A message fragment for logging typically containing information about
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public override int GetServiceProviderHashCode()
=> 0;

public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
=> true;
=> other is ExtensionInfo;

public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
=> debugInfo["SqlServer:" + nameof(SqlServerNetTopologySuiteDbContextOptionsBuilderExtensions.UseNetTopologySuite)] = "1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public ExtensionInfo(IDbContextOptionsExtension extension)
public override bool IsDatabaseProvider
=> true;

public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
=> other is ExtensionInfo;

public override string LogFragment
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public ExtensionInfo(IDbContextOptionsExtension extension)
public override bool IsDatabaseProvider
=> true;

public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
=> other is ExtensionInfo;

public override string LogFragment
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public override int GetServiceProviderHashCode()
=> 0;

public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
=> true;
=> other is ExtensionInfo;

public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
=> debugInfo["NetTopologySuite"] = "1";
Expand Down