public void HandleEvent(RouteNetworkEditOperationOccuredEvent request) { _logger.LogDebug("Got route network edit opreation occured message:"); if (request.RouteNetworkCommands != null) { foreach (var command in request.RouteNetworkCommands) { if (command.RouteNetworkEvents != null) { var trans = _networkState.GetTransaction(); foreach (var routeNetworkEvent in command.RouteNetworkEvents) { switch (routeNetworkEvent) { case RouteNodeAdded domainEvent: HandleEvent(domainEvent, trans); break; case RouteNodeMarkedForDeletion domainEvent: HandleEvent(domainEvent, trans); break; case RouteSegmentAdded domainEvent: HandleEvent(domainEvent, trans); break; case RouteSegmentMarkedForDeletion domainEvent: HandleEvent(domainEvent, trans); break; case RouteSegmentRemoved domainEvent: HandleEvent(domainEvent, trans); break; case NamingInfoModified domainEvent: HandleEvent(domainEvent, trans); break; case LifecycleInfoModified domainEvent: HandleEvent(domainEvent, trans); break; case MappingInfoModified domainEvent: HandleEvent(domainEvent, trans); break; case SafetyInfoModified domainEvent: HandleEvent(domainEvent, trans); break; case RouteNodeInfoModified domainEvent: HandleEvent(domainEvent, trans); break; case RouteSegmentInfoModified domainEvent: HandleEvent(domainEvent, trans); break; case RouteNodeGeometryModified domainEvent: HandleEvent(domainEvent, trans); break; case RouteSegmentGeometryModified domainEvent: HandleEvent(domainEvent, trans); break; default: _logger.LogWarning($"No handler defined for event: {routeNetworkEvent.GetType().Name}"); break; } } _networkState.FinishWithTransaction(); // Process eventually splits that might requires updates to route network interests if (command.CmdType == "ExistingRouteSegmentSplitted") { HandleSplitCommand(request, command, trans); } } } } }