title: Migrating from ASP.NET CORE 3.0 to 3.1
body: <p>I'm trying to migrate my project from asp.net core 3.0 to 3.1 and I have found one issue:</p>
  <pre><code>public static bool CheckConnection(this DataContext dataContext)
      {
          try
          {
              return dataContext.Database.CanConnect();
          }
          catch(SqlException)
          {
              return false;
          }
      }
  </code></pre>
  <p>this code worked in version 3.0, but when I have migrated I got this exception:</p>
  <blockquote>
  <p>System.InvalidOperationException
  HResult=0x80131509
  Message=The database provider attempted to register an implementation of the 'IRelationalTypeMappingSource' service. This is not a service defined by EF and as such must be registered as a provider-specific service using the 'TryAddProviderSpecificServices' method.
  Source=Microsoft.EntityFrameworkCore
  StackTrace:
  at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.GetServiceCharacteristics(Type serviceType)
  at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.TryAdd(Type serviceType, Type implementationType)
  at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.TryAddTService,TImplementation
  at Microsoft.Extensions.DependencyInjection.SqlServerServiceCollectionExtensions.AddEntityFrameworkSqlServer(IServiceCollection serviceCollection)
  at Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal.SqlServerOptionsExtension.ApplyServices(IServiceCollection services)
  at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.ApplyServices(IDbContextOptions options, ServiceCollection services)
  at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.&lt;&gt;c__DisplayClass4_0.g__BuildServiceProvider|3()
  at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.&lt;&gt;c__DisplayClass4_0.b__2(Int64 k)
  at System.Collections.Concurrent.ConcurrentDictionary<code>2.GetOrAdd(TKey key, Func</code>2 valueFactory)
  at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options, Boolean providerRequired)
  at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
  at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure&lt;System.IServiceProvider&gt;.get_Instance()
  at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService[TService](IInfrastructure<code>1 accessor) at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure</code>1 accessor)
  at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.get_Dependencies()
  at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.CanConnect()
  at FooBar.AppCore.DbSetExtension.CheckConnection(DataContext dataContext) in D:\Work\FooBar\FooBar\AppCore\DbSetExtension.cs:line 331
  at FooBar.Startup.ConfigureServices(IServiceCollection services) in D:\Work\FooBar\FooBar\Startup.cs:line 68
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
  at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.&lt;&gt;c__DisplayClass9_0.g__Startup|0(IServiceCollection serviceCollection)
  at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
  at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.&lt;&gt;c__DisplayClass8_0.b__0(IServiceCollection services)
  at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services)
  at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.&lt;&gt;c__DisplayClass12_0.b__0(HostBuilderContext context, IServiceCollection services)
  at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
  at Microsoft.Extensions.Hosting.HostBuilder.Build()
  at FooBar.Program.Main(String[] args) in D:\Work\FooBar\FooBar\Program.cs:line 17</p>
  </blockquote>
  <p>Am I missing something or it is common problem and I have to change my code?</p>
  <p>Thanks for any suggestion.</p>