/// <summary> /// Handles the message provided. /// </summary> /// <param name="message">The message to be handled.</param> public async void Handle(BookingCancelledEvent message) { if (message.TherapistId != TherapistId.Empty) { await _repository .UpdateTherapistBookingAsync( message.TenantId, message.BookingId, message.TherapistId, BookingStatus.CancelledByTherapist, null, CancellationToken.None) .ConfigureAwait(false); } else { await _repository .UpdateBookingAsync( message.TenantId, message.BookingId, BookingStatus.CancelledByClient, null, null, CancellationToken.None) .ConfigureAwait(false); } }
private void Handle(BookingCancelledEvent e) { var booking = context.Set <BookingEntity>().Find(e.Booking.Id); booking.Status = (int)e.Booking.Status; booking.ModifiedBy = "Anonymous"; booking.ModifiedDate = DateTime.Now; context.Set <BookingEntity>().Update(booking); }