private void OnVacationCancel(VacationIsCancelled message) { if (this.eventsById.ContainsKey(message.EventId)) { this.eventsById.Remove(message.EventId); } }
private void OnVacationCancel(VacationIsCancelled message) { if (this.EventsById.TryGetValue(message.EventId, out var calendarEvent)) { this.EventsById.Remove(message.EventId); var text = $"Got vacation canceled ({calendarEvent.Dates.StartDate.ToLongDateString()} - {calendarEvent.Dates.EndDate.ToLongDateString()})"; var msg = new Message(Guid.NewGuid().ToString(), this.EmployeeId, "Vacation", text, message.TimeStamp.Date); this.employeeFeed.Tell(new PostMessage(msg)); } }