public AppCore(string filePath) { IsDisposed = false; ConnectionString = new LiteDB.ConnectionString { Filename = filePath, Password = null }; }
public App() { var connectionString = new LiteDB.ConnectionString(); connectionString.Filename = "todo.db"; // Container DIContainer.Options.DefaultLifestyle = SimpleInjector.Lifestyle.Singleton; // InterfaceAdapter DIContainer.Register<UseCase.ITodoRepositry>(() => new Repositry.TodoRepositry(connectionString)); DIContainer.Register<UseCase.IListTodoPresenter, Presenter.ListTodoPresenter>(); DIContainer.Register<UseCase.ICreateTodoController, Controller.CreateTodoController>(); // UseCase DIContainer.Register<UseCase.ListTodoHandler>(); DIContainer.Register<UseCase.CreateTodoHandler>(); DIContainer.Verify(); }
public TodoRepositry(LiteDB.ConnectionString connectionString) { this.connectionString = connectionString; }