コード例 #1
0
        public async Task <KeyValuePair <string, string> > BookHotel([ActivityTrigger] BookHotelMessage content, ILogger log)
        {
            log.LogInformation($"Starting BookHotel Activity");
            var result = await _bookHotelService.BookHotels(content);

            return(new KeyValuePair <string, string>("hotel", result));
        }
コード例 #2
0
        public async Task Run([ServiceBusTrigger("booking", "booking-hotel", Connection = "ServicebusConnectionString")] string mySbMsg, ILogger log)
        {
            log.LogInformation($"C# ServiceBus topic trigger function processed message: {mySbMsg}"); log.LogInformation($"C# ServiceBus topic trigger function processed message: {mySbMsg}");

            var bookHotelModel = JsonConvert.DeserializeObject <BookHotelMessage>(mySbMsg);

            var hotelResult = await _bookHotelService.BookHotels(bookHotelModel);

            await _sendGridService.SendEmailWithInformation(bookHotelModel.Email, null, hotelResult);
        }