Пример #1
0
 public string Get()
 {
     return($@"
         IOptions<>:         { _settings.Value.Option1 } 
         IOptionsSnapshot<>: { _service.GetValue() },
         Are same:           { _service == _settings }");
 }
        public static async Task <string> Run(HttpRequestMessage req, IAsyncCollector <string> outputQueues, TraceWriter log)
        {
            ValueService valueService = new ValueService();

            log.Info("C# HTTP trigger function processed a request.");

            var body = await req.Content.ReadAsStringAsync().ConfigureAwait(false);

            var id = req.GetQueryNameValuePairs()
                     .FirstOrDefault(q => string.Compare(q.Key, "id", true) == 0).Value;;
            var result = valueService.GetValue(int.Parse(id));

            // Make sure it returns HTTP Status Code of 202 (Accepted).
            return(await result);
        }
 // GET api/values/5
 public async Task <string> Get(int id)
 {
     return(await valueService.GetValue(id));
 }