Exemplo n.º 1
0
 public virtual Response <IReadOnlyList <VnetRoute> > GetRoutesForVnet(CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("ServerfarmVirtualNetworkConnection.GetRoutesForVnet");
     scope.Start();
     try
     {
         var response = _appServicePlansRestClient.ListRoutesForVnet(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         return(Response.FromValue(response.Value, response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
        public virtual Pageable <VnetRoute> GetRoutesForVnet(CancellationToken cancellationToken = default)
        {
            Page <VnetRoute> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _serverfarmVirtualNetworkConnectionAppServicePlansClientDiagnostics.CreateScope("ServerfarmVirtualNetworkConnection.GetRoutesForVnet");
                scope.Start();
                try
                {
                    var response = _serverfarmVirtualNetworkConnectionAppServicePlansRestClient.ListRoutesForVnet(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value, null, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, null));
        }