public static IPublishCommands GetCommandPublisher()
        {
            var commandPublisher = new LocalCommandPublisher();
            var unitOfWork = new EntityFrameworkUnitOfWork(ContextFactory);

            commandPublisher.Subscribe(new ClientService(unitOfWork, Logger));

            return commandPublisher;
        }
        public static IPublishCommands GetCommandPublisher()
        {
            var commandPublisher = new LocalCommandPublisher();
            var unitOfWork = new InMemoryUnitOfWork(DataStore);

            commandPublisher.Subscribe(new ClientService(unitOfWork, Logger));

            return commandPublisher;
        }
Пример #3
0
        public static IPublishCommands GetCommandPublisher()
        {
            var commandPublisher = new LocalCommandPublisher();

            var unitOfWork = new UnitOfWork((dynamic)ContextFactory.Context);
            commandPublisher.Subscribe(new ClientService(unitOfWork, Logger));

            return commandPublisher;
        }
Пример #4
0
        public static IPublishCommands GetCommandPublisher()
        {
            var commandPublisher = new LocalCommandPublisher();
            var unitOfWork = new UnitOfWork(DataStore);

            commandPublisher.Subscribe(new RegisterClientHandler(unitOfWork, Logger));
            commandPublisher.Subscribe(new FetchClientHandler(unitOfWork, Logger));
            commandPublisher.Subscribe(new AddAddressToClientHandler(unitOfWork, Logger));
            commandPublisher.Subscribe(new FetchClientAddressHandler(unitOfWork, Logger));
            return commandPublisher;
        }
Пример #5
0
        public static IPublishCommands GetCommandPublisher(bool useDatabase)
        {
            var commandPublisher = new LocalCommandPublisher();

            IUnitOfWork unitOfWork;

            if (useDatabase)
            {
                DbContext dbContext = new AbsaContext("AbsaBank_Dev", OnContextCreationEnum.CreateIfDoesntExist);
                unitOfWork = new UnitOfWork(dbContext);
            }
            else
            {
                unitOfWork = new InMemoryUnitOfWork(DataStore);
            }

            commandPublisher.Subscribe(new ClientService(unitOfWork, Logger));

            return commandPublisher;
        }
        public static IPublishCommands GetCommandPublisher()
        {
            AsbaBankContext context = new AsbaBankContext("ASBA");

            if (!context.Database.Exists())
            {
                context.Database.Create();
            }
            else
            {
                context.Database.Delete();
                context.Database.Create();

            }

            var commandPublisher = new LocalCommandPublisher();
            var unitOfWork = new EntityFrameworkUnitOfWork(context);

            commandPublisher.Subscribe(new ClientService(unitOfWork, Logger));

            return commandPublisher;
        }