public Program([NotNull] IServiceProvider serviceProvider, [NotNull] IApplicationEnvironment appEnv, [NotNull] ILibraryManager libraryManager) { Check.NotNull(serviceProvider, nameof(serviceProvider)); Check.NotNull(appEnv, nameof(appEnv)); Check.NotNull(libraryManager, nameof(libraryManager)); _projectDir = appEnv.ApplicationBasePath; _rootNamespace = appEnv.ApplicationName; var loggerProvider = new LoggerProvider(name => new ConsoleCommandLogger(name, verbose: true)); var assemblyName = new AssemblyName(appEnv.ApplicationName); var assembly = Assembly.Load(assemblyName); _migrationTool = new MigrationTool(loggerProvider, assembly); _databaseTool = new DatabaseTool(serviceProvider, loggerProvider); _libraryManager = libraryManager; }
public Program([NotNull] IServiceProvider serviceProvider, [NotNull] IApplicationEnvironment appEnv, [NotNull] ILibraryManager libraryManager) { Check.NotNull(serviceProvider, nameof(serviceProvider)); Check.NotNull(appEnv, nameof(appEnv)); Check.NotNull(libraryManager, nameof(libraryManager)); _projectDir = appEnv.ApplicationBasePath; _rootNamespace = appEnv.ApplicationName; var loggerProvider = new LoggerProvider(name => new ConsoleCommandLogger(name, verbose: true)); var assemblyName = new AssemblyName(appEnv.ApplicationName); var assembly = Assembly.Load(assemblyName); _migrationTool = new MigrationTool(loggerProvider, assembly); _databaseTool = new DatabaseTool(serviceProvider, loggerProvider); _libraryManager = libraryManager; }
public Executor([NotNull] object logHandler, [NotNull] IDictionary args) { Check.NotNull(logHandler, nameof(logHandler)); Check.NotNull(args, nameof(args)); var unwrappedLogHandler = logHandler as ILogHandler ?? new ForwardingProxy <ILogHandler>(logHandler).GetTransparentProxy(); var loggerProvider = new LoggerProvider(name => new CommandLoggerAdapter(name, unwrappedLogHandler)); var targetPath = (string)args["targetPath"]; _projectDir = (string)args["projectDir"]; _rootNamespace = (string)args["rootNamespace"]; var assemblyName = AssemblyName.GetAssemblyName(targetPath); var assembly = Assembly.Load(assemblyName); _migrationTool = new MigrationTool(loggerProvider, assembly); _databaseTool = new DatabaseTool(null, loggerProvider); }
public Program([NotNull] IServiceProvider serviceProvider, [NotNull] IApplicationEnvironment appEnv, [NotNull] ILibraryManager libraryManager, [NotNull] IRuntimeEnvironment runtimeEnv, [NotNull] IApplicationShutdown applicationShutdown) { Check.NotNull(serviceProvider, nameof(serviceProvider)); Check.NotNull(appEnv, nameof(appEnv)); Check.NotNull(libraryManager, nameof(libraryManager)); Check.NotNull(runtimeEnv, nameof(runtimeEnv)); Check.NotNull(applicationShutdown, nameof(applicationShutdown)); _runtimeEnv = runtimeEnv; _projectDir = appEnv.ApplicationBasePath; _rootNamespace = appEnv.ApplicationName; _applicationShutdown = applicationShutdown; var loggerProvider = new LoggerProvider(name => new ConsoleCommandLogger(name, verbose: true)); var assemblyName = new AssemblyName(appEnv.ApplicationName); var assembly = Assembly.Load(assemblyName); _migrationTool = new MigrationTool(loggerProvider, assembly, serviceProvider); _databaseTool = new DatabaseTool(serviceProvider, loggerProvider); _libraryManager = libraryManager; _logger = loggerProvider.CreateLogger(typeof(Program).FullName); }
public Program([NotNull] IServiceProvider serviceProvider, [NotNull] IApplicationEnvironment appEnv, [NotNull] ILibraryManager libraryManager, [NotNull] IRuntimeEnvironment runtimeEnv, [NotNull] IApplicationShutdown applicationShutdown) { Check.NotNull(serviceProvider, nameof(serviceProvider)); Check.NotNull(appEnv, nameof(appEnv)); Check.NotNull(libraryManager, nameof(libraryManager)); Check.NotNull(runtimeEnv, nameof(runtimeEnv)); Check.NotNull(applicationShutdown, nameof(applicationShutdown)); _runtimeEnv = runtimeEnv; _projectDir = appEnv.ApplicationBasePath; _rootNamespace = appEnv.ApplicationName; _applicationShutdown = applicationShutdown; var loggerProvider = new LoggerProvider(name => new ConsoleCommandLogger(name, verbose: true)); var assemblyName = new AssemblyName(appEnv.ApplicationName); var assembly = Assembly.Load(assemblyName); _migrationTool = new MigrationTool(loggerProvider, assembly, serviceProvider); _databaseTool = new DatabaseTool(serviceProvider, loggerProvider); _libraryManager = libraryManager; _logger = loggerProvider.CreateLogger(typeof(Program).FullName); }