public void REGISTER_PROJECTIONS() { var appendStore = new FileAppendOnlyStore( @"C:\Users\wydev\Documents\GitHub\Clones\lokad-iddd-sample\DomainTests\Store\"); var eventStore = new EventStore(appendStore); var publisher = new DomainEventPublisher(eventStore,0,500); var store = new FileDocumentReaderWriter<CustomerId,CustomerTransactions>(@"C:\Users\wydev\Documents\GitHub\Clones\lokad-iddd-sample\DomainTests\Store\", new ViewStrategy(@"C:\Users\wydev\Documents\GitHub\Clones\lokad-iddd-sample\DomainTests\Views\")); IDocumentWriter<CustomerId,CustomerTransactions> writer = store; var projection = new CustomerTransactionsProjection(writer); publisher.RegisterProjection(projection); var id = new CustomerId(2); var @event = new CustomerCreated { Id = id, Name = "Microsoft", Currency = Currency.Eur }; IList<IEvent> Changes = new List<IEvent>(); Changes.Add(@event); eventStore.AppendToStream(id,0,Changes); publisher.ProcessNewEvents(); }
public void REGISTER_PROJECTIONS() { var appendStore = new FileAppendOnlyStore(@"C:\Users\wydev\Documents\GitHub\Clones\lokad-iddd-sample\DomainTests\Store\"); var eventStore = new EventStore(appendStore); var publisher = new DomainEventPublisher(eventStore, 0, 500); var store = new FileDocumentReaderWriter <CustomerId, CustomerTransactions>(@"C:\Users\wydev\Documents\GitHub\Clones\lokad-iddd-sample\DomainTests\Store\", new ViewStrategy(@"C:\Users\wydev\Documents\GitHub\Clones\lokad-iddd-sample\DomainTests\Views\")); IDocumentWriter <CustomerId, CustomerTransactions> writer = store; var projection = new CustomerTransactionsProjection(writer); publisher.RegisterProjection(projection); var id = new CustomerId(2); var @event = new CustomerCreated { Id = id, Name = "Microsoft", Currency = Currency.Eur }; IList <IEvent> Changes = new List <IEvent>(); Changes.Add(@event); eventStore.AppendToStream(id, 0, Changes); publisher.ProcessNewEvents(); }
private static void RegisterMessageRoutes() { var folderPathDocs = HttpContext.Current.Server.MapPath("~/App_Data/Documents"); var strategy = NinjectKernel.Get<IDocumentStrategy>(); var writer = new FileDocumentReaderWriter<RegistrationID, RegistrationView>(folderPathDocs, strategy); var handler = NinjectKernel.Get<MessageHandler>(); handler.WireToLambda<RegistrationCreated>(new RegistrationCreatedHandler(writer).Handle); }
public void Setup() { var tmpPath = Path.GetTempPath(); var documentStrategy = new DocumentStrategy(); _reader = new FileDocumentReaderWriter<Guid, int>(tmpPath, documentStrategy); _writer = new FileDocumentReaderWriter<Guid, int>(tmpPath, documentStrategy); _testClassReader = new FileDocumentReaderWriter<unit, Test1>(tmpPath, documentStrategy); _testClassWtiter = new FileDocumentReaderWriter<unit, Test1>(tmpPath, documentStrategy); _guidKeyClassReader = new FileDocumentReaderWriter<Guid, Test1>(tmpPath, documentStrategy); _guidKeyClassWriter = new FileDocumentReaderWriter<Guid, Test1>(tmpPath, documentStrategy); }
public void Setup() { var tmpPath = Path.GetTempPath(); var documentStrategy = new DocumentStrategy(); _reader = new FileDocumentReaderWriter <Guid, int>(tmpPath, documentStrategy); _writer = new FileDocumentReaderWriter <Guid, int>(tmpPath, documentStrategy); _testClassReader = new FileDocumentReaderWriter <unit, Test1>(tmpPath, documentStrategy); _testClassWtiter = new FileDocumentReaderWriter <unit, Test1>(tmpPath, documentStrategy); _guidKeyClassReader = new FileDocumentReaderWriter <Guid, Test1>(tmpPath, documentStrategy); _guidKeyClassWriter = new FileDocumentReaderWriter <Guid, Test1>(tmpPath, documentStrategy); }