예제 #1
0
 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();
        }
예제 #3
0
 public TodoRepositry(LiteDB.ConnectionString connectionString)
 {
     this.connectionString = connectionString;
 }