Beispiel #1
0
 public static ResourceLogHistoryDocument ToDocument(this ResourceLogHistory history)
 => new ResourceLogHistoryDocument()
 {
     CollectionId = history.CollectionId,
     ResourceId   = history.ResourceId,
     Id           = history.Id,
     Logs         = history.Logs.Select(p => p.ToDocument())
                    .ToList(),
     Version = history.Version
 };
        public async Task Handle(LoggedEntityCreatedDomainEvent @event)
        {
            var history = await _repository.GetbyResourceId(@event.ResourceId);

            if (history == null)
            {
                var logs = ResourceLogHistory.Create();
                logs.ApplyEvent(@event);
                await _repository.AddAsync(logs);
            }
        }
Beispiel #3
0
 public async Task UpdateAsync(ResourceLogHistory history)
 => await _repository.Update(history.ToDocument());
Beispiel #4
0
 public async Task Remove(ResourceLogHistory resourceLogHistory)
 => await _repository.Delete(resourceLogHistory.ToDocument());
Beispiel #5
0
 public async Task AddAsync(ResourceLogHistory history)
 => await _repository.AddAsync(history.ToDocument());