public async Task <IEnumerable <INotification> > Create(RouteSegment before, RouteSegment after) { var notifications = new List <INotification>(); if (before is null || after is null) { notifications.Add(new DoNothing($"Before or after route node is null, cannot update info.")); return(notifications); } var routeSegmentShadowTable = await _geoDatabase.GetRouteSegmentShadowTable(after.Mrid, true); if (routeSegmentShadowTable is null) { notifications.Add( new DoNothing( $"Could not find {nameof(RouteSegment)} in shadowtable with id '{after.Mrid}'")); return(notifications); } if (AlreadyUpdated(after, routeSegmentShadowTable)) { notifications.Add( new DoNothing( $"{nameof(RouteSegment)} with id '{after.Mrid}' is already updated, therefore do nothing.")); return(notifications); } if (routeSegmentShadowTable.MarkAsDeleted) { notifications.Add( new DoNothing( $"Shadowtable {nameof(RouteSegment)} with id '{after.Mrid}' is marked to be deleted, info cannot be updated.")); return(notifications); } if (IsRouteSegmentInfoModified(before, after)) { notifications.Add(new RouteSegmentInfoUpdated(after)); } if (IsLifecycleInfoModified(before, after)) { notifications.Add(new RouteSegmentLifecycleInfoUpdated(after)); } if (IsMappingInfoModified(before, after)) { notifications.Add(new RouteSegmentMappingInfoUpdated(after)); } if (IsNamingInfoModified(before, after)) { notifications.Add(new RouteSegmentNamingInfoUpdated(after)); } if (IsSafetyInfoModified(before, after)) { notifications.Add(new RouteSegmentSafetyInfoUpdated(after)); } if (notifications.Any()) { await _geoDatabase.UpdateRouteSegmentInfosShadowTable(after); } return(notifications); }