public async Task ParseRequestAsync(string requestBody) { var updateMessage = JsonConvert.DeserializeObject <UpdateMessage>(requestBody); var messageType = updateMessage.ParseMessageType(); switch (messageType) { case UpdateMessageType.Unknown: break; case UpdateMessageType.GetNewOccasionName: await _occasionService.RequestNewOccasionNameAsync(updateMessage); break; case UpdateMessageType.CreateOccasion: await _occasionService.CreateAsync(updateMessage); break; case UpdateMessageType.GetOccasionsForDelete: await _occasionService.GetOccasionsForDeleteAsync(updateMessage); break; case UpdateMessageType.DeleteOccasion: await _occasionService.DeleteAsync(updateMessage); break; case UpdateMessageType.GetOccasionsToStart: await _occasionService.GetOccasionsToStartAsync(updateMessage); break; case UpdateMessageType.StartPoll: await _pollService.StartAsync(updateMessage); break; case UpdateMessageType.StopActivePoll: await _pollService.StopAllActivePollsAsync(updateMessage); break; case UpdateMessageType.PollAnswered: await _pollService.AddAnswerAsync(updateMessage); break; case UpdateMessageType.Stats: await _statsService.ShowAsync(updateMessage); break; default: throw new ArgumentOutOfRangeException(); } }