Beispiel #1
0
        public async Task <bool> Health()
        {
            try
            {
                // Try to fetch a random postcode from CCG service to test if Table storage works fine
                var result = await _ccgService.GetCCGDetails(postCodes[r.Next(postCodes.Length)]);

                return(result != null);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #2
0
        public async Task <IActionResult> Get(string postcode)
        {
            if (IsBadRequest(postcode))
            {
                return(BadRequest());
            }

            var result = await _service.GetCCGDetails(postcode);

            if (result == null)
            {
                return(NotFound());
            }

            return(Ok(result));
        }