private void EnsureServices(IServiceProvider services)
        {
            var providerServices = services.GetRequiredService <IDatabaseProviderServices>();

            if (!(providerServices is IRelationalDatabaseProviderServices))
            {
                throw new OperationException(DesignCoreStrings.NonRelationalProvider(providerServices.InvariantName));
            }

            var assemblyName           = _assembly.GetName();
            var options                = services.GetRequiredService <IDbContextOptions>();
            var contextType            = services.GetRequiredService <ICurrentDbContext>().Context.GetType();
            var migrationsAssemblyName = RelationalOptionsExtension.Extract(options).MigrationsAssembly
                                         ?? contextType.GetTypeInfo().Assembly.GetName().Name;

            if (assemblyName.Name != migrationsAssemblyName &&
                assemblyName.FullName != migrationsAssemblyName)
            {
                throw new OperationException(
                          DesignCoreStrings.MigrationsAssemblyMismatch(assemblyName.Name, migrationsAssemblyName));
            }
        }