public void Add_new_value()
        {
            Test1 t = new Test1 {
                Value = 555
            };

            var newValue = _guidKeyClassWriter.Add(Guid.NewGuid(), t);

            t.Should().Be(newValue);

            555.Should().Be(newValue.Value);
        }
Beispiel #2
0
 public void When(UserCreated e)
 {
     _store.Add(e.AggregateId, new ActiveUserView
     {
         Id = e.AggregateId
     });
 }
Beispiel #3
0
        public Task When(GroupCreated domainEvent)
        {
            var projection = new GroupDetailProjection
            {
                Id = domainEvent.Id
            };

            return(_projectionWriter.Add(projection));
        }
 public async Task When(SampleStarted e)
 {
     await _writer.Add(e.Id, new SampleView
     {
         Id     = e.Id,
         Name   = e.Name,
         Status = SampleStatus.Draft
     });
 }
Beispiel #5
0
        public Task When(UserCreated domainEvent)
        {
            var projection = new UserDetailProjection
            {
                Id   = domainEvent.Id,
                Name = domainEvent.Name
            };

            return(_projectionWriter.Add(projection));
        }
Beispiel #6
0
        public async Task HandleAsync(MyEntityCreatedEvent @event)
        {
            _elasticSearchProjectionWriter.Add <MyEntityView>(new MyEntityView()
            {
                Id          = @event.AggregateId,
                PropertyOne = @event.PropertyOne,
                ProperyTwo  = @event.PropertyTwo
            });

            await Task.CompletedTask;
        }
Beispiel #7
0
 public void When(Metadata <UserCreated> e)
 {
     _store.Add(e.Data.AggregateId, new AllUserView
     {
         Id         = e.Data.AggregateId,
         Fullname   = $"{e.Data.LastName}, {e.Data.FirstName}",
         BirthMonth = e.Data.BornDate.Month,
         BirthYear  = e.Data.BornDate.Year,
         CreatedAt  = e.Data.CreatedAt
     });
 }
 public void When(OrderCreated e)
 {
     writer.Add(new OrdersView
     {
         Id         = e.Id,
         Version    = e.Version,
         CreatedOn  = e.CreatedOn,
         UpdatedOn  = e.CreatedOn,
         Status     = OrderStatus.Draft,
         CustomerId = e.CustomerId,
         SenderId   = e.SenderId
     });
 }
Beispiel #9
0
 public async Task When(ProjectAdded e)
 {
     await _writer.Add(new ProjectsView { Id = e.Id, Name = e.Name });
 }