Exemplo n.º 1
0
 public ActionResult <string> Post(SmartCommunities_APP appData)
 {
     // using (var reader = new StreamReader(Request.Body))
     // {
     //     var body = reader.ReadToEnd();
     //     Console.WriteLine($"POST: Got From Request: {body}");
     // }
     return(validateApplicationKey(appData));
 }
Exemplo n.º 2
0
        public ContentResult validateApplicationKey(SmartCommunities_APP appData)
        {
            // Call into a IotEdge cached copy of Application ID's (GUID) - some DB on device?
            IDictionary <string, string> appList = new Dictionary <string, string>();

            appList.Add("ePolice", "some value for ePolice");
            appList.Add("eHealth", "some value for eHealth");

            ContentResult contentQuality = new ContentResult();

            if (appList.ContainsKey(appData.appID))
            {
                contentQuality.StatusCode = 200;
                contentQuality.Content    = JsonConvert.SerializeObject(appData);
            }
            else
            {
                contentQuality.StatusCode = 400;
                contentQuality.Content    = "invalid appID";
            }

            return(contentQuality);
        }