コード例 #1
0
        public async Task <IActionResult> Random()
        {
            var viewModel  = new RandomViewModel();
            var randomJoke = await _jokeService.GetRandomJoke();

            viewModel.RandomJoke = randomJoke.Joke;

            return(View(viewModel));
        }
コード例 #2
0
        public async Task <DadJokeVM> GetRandomJoke()
        {
            var vm = new DadJokeVM();

            var joke = await _jokeService.GetRandomJoke();

            vm.Joke = joke.Joke;

            return(vm);
        }
コード例 #3
0
        public async Task <JokeModel> Get()
        {
            var result = await _service.GetRandomJoke();

            return(result);
        }
コード例 #4
0
        public async Task Joke(IDialogContext context, LuisResult result)
        {
            await context.PostAsync(await _jokeService.GetRandomJoke());

            context.Wait(MessageReceived);
        }