public MigrationsOperations( [NotNull] ILoggerProvider loggerProvider, [NotNull] string assemblyName, [NotNull] string startupAssemblyName, [NotNull] string projectDir, [NotNull] string rootNamespace, [CanBeNull] IServiceProvider dnxServices = null) { Check.NotNull(loggerProvider, nameof(loggerProvider)); Check.NotEmpty(assemblyName, nameof(assemblyName)); Check.NotEmpty(startupAssemblyName, nameof(startupAssemblyName)); Check.NotNull(projectDir, nameof(projectDir)); Check.NotNull(rootNamespace, nameof(rootNamespace)); var loggerFactory = new LoggerFactory(); loggerFactory.AddProvider(loggerProvider); _loggerProvider = loggerProvider; _logger = new LazyRef<ILogger>(() => loggerFactory.CreateCommandsLogger()); _projectDir = projectDir; _rootNamespace = rootNamespace; _servicesBuilder = new DesignTimeServicesBuilder(dnxServices); _contextOperations = new DbContextOperations( loggerProvider, assemblyName, startupAssemblyName, dnxServices); }
public MigrationsOperations( [NotNull] ILoggerProvider loggerProvider, [NotNull] string assemblyName, [NotNull] string startupAssemblyName, [CanBeNull] string environment, [NotNull] string projectDir, [NotNull] string rootNamespace) { Check.NotNull(loggerProvider, nameof(loggerProvider)); Check.NotEmpty(assemblyName, nameof(assemblyName)); Check.NotEmpty(startupAssemblyName, nameof(startupAssemblyName)); Check.NotNull(projectDir, nameof(projectDir)); Check.NotNull(rootNamespace, nameof(rootNamespace)); var loggerFactory = new LoggerFactory(); loggerFactory.AddProvider(loggerProvider); _loggerProvider = loggerProvider; _logger = new LazyRef <ILogger>(() => loggerFactory.CreateCommandsLogger()); _assemblyName = assemblyName; _projectDir = projectDir; _rootNamespace = rootNamespace; _contextOperations = new DbContextOperations( loggerProvider, assemblyName, startupAssemblyName, environment); var startup = new StartupInvoker(startupAssemblyName, environment); _servicesBuilder = new DesignTimeServicesBuilder(startup); }