コード例 #1
0
        public async Task <IActionResult> GetAsync(int id, DateTime?realtime_start, DateTime?realtime_end)
        {
            SourceResponse result = new SourceResponse();

            try
            {
                api.Arguments.ApiKey    = appSettings.ApiKey;
                api.Arguments.source_id = id;

                api.Arguments.realtime_start = realtime_start ?? api.Arguments.realtime_start;
                api.Arguments.realtime_end   = realtime_end ?? api.Arguments.realtime_end;

                result.container = await api.FetchAsync();

                SetApiValues(api, result);
            }
            catch (Exception exception)
            {
                logger.LogError(exception, "GetSource failed");
                return(StatusCode(500));
            }

            return(Ok(result));
        }