public async Task Process(EditResourceCommand command, Unit response, CancellationToken cancellationToken) { var history = HistoryEntry.Create(Guid.NewGuid(), "Resource was updated", _httpContextAccessor.HttpContext.User.Identity.Name, command.Id, DateTimeOffset.UtcNow); await _context.AddAsync(history); }
public async Task Process(BookResourceCommand command, BookResourceResult response, CancellationToken cancellationToken) { var description = response.IsUserInLine ? "User got in line." : $"Resource was booked. Reason: \"{command.BookingReason}\"."; var history = HistoryEntry.Create(Guid.NewGuid(), description, command.BookedBy.Login, command.ResourceId, DateTimeOffset.UtcNow); await _context.AddAsync(history); }