Beispiel #1
0
        public async Task <IActionResult> PostAsync(
            [FromBody] MessageBOptions messageBOptions)
        {
            var messageAddOptions =
                new MessageAddOptions
            {
                Data    = messageBOptions,
                Type    = "webapp1-messageb",
                Subject = "MessageB.Added"
            };

            await _messageAdd.AddAsync(messageAddOptions);

            return(new OkObjectResult(messageAddOptions));
        }
Beispiel #2
0
        public async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation("MessageBHttpTrigger processed a request.");

            var messageBOptions =
                JsonConvert.DeserializeObject <MessageBOptions>(
                    await new StreamReader(req.Body).ReadToEndAsync());

            var messageAddOptions =
                new MessageAddOptions
            {
                Data    = messageBOptions,
                Type    = "funcapp1-messageb",
                Subject = "MessageB.Added"
            };

            await _messageAdd.AddAsync(messageAddOptions);

            return(new OkObjectResult(messageAddOptions));
        }
Beispiel #3
0
 public async Task <bool> AddAsync(
     MessageAddOptions messageAddOptions)
 {
     return(await Task.FromResult(true));
 }