示例#1
0
        public void OnGet()
        {
            Options = _options.Value;
            var response = _apiManager.GetAll();

            if (!response.IsError)
            {
                Apis = response.Data;
            }
        }
示例#2
0
 public async Task <IList <ApiModel> > Get(string serviceId)
 {
     try
     {
         if (!string.IsNullOrEmpty(serviceId))
         {
             return(await _manager.GetByService(ApiKey, serviceId));
         }
         else
         {
             return(await _manager.GetAll(ApiKey));
         }
     }
     catch (ApiGatewayException e)
     {
         if (e.ErrorCode == HttpStatusCode.NotFound)
         {
             Response.StatusCode = (int)e.ErrorCode;
         }
     }
     return(null);
 }