Example #1
0
        public static IActionResult HttpIntegrated(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]
            HttpRequest req,
            ILogger log,
            [Elastic(Index = "people", IndexType = "wibble")]
            out ElasticMessage <Wibble> elasticMessage)
        {
            log.LogInformation("C# HTTP trigger function2 processed a request.");

            string name = req.Query["name"];

            elasticMessage = new ElasticMessage <Wibble>(new Wibble {
                Name = name, Value = 20
            });

            return(name != null
                ? (ActionResult) new OkObjectResult($"Hello2, {name}")
                : new BadRequestObjectResult("Please pass a name on the query string"));
        }
        public ElasticResult <ElasticMessage> AddAdminMessage(string chatGuid, ElasticUser user, string text)
        {
            var message = new ElasticMessage(chatGuid, user.Guid, user.UserName, text, true);

            return(_entityRepository.Add(EsType, message));
        }