public async Task Label(DateTimeOffset eventDate, LabelPayload payload) { var updater = new DataUpdater(_contextFactory, _mapper); await updater.UpdateRepositories(eventDate, new[] { payload.Repository }); switch (payload.Action) { case "created": case "edited": await updater.UpdateLabels(payload.Repository.Id, new[] { payload.Label }); break; case "deleted": await updater.DeleteLabel(payload.Label.Id); break; default: throw new NotImplementedException($"Action '{payload.Action}' is not valid for event {nameof(Label)}."); } await updater.Changes.Submit(_queueClient); }