Beispiel #1
0
        private static Pageable <GenericResourceExpanded> ListAtContextInternal(
            ResourceOperations resourceOperations,
            string scopeFilter = null,
            ResourceFilterCollection resourceFilters = null,
            string expand = null,
            int?top       = null,
            CancellationToken cancellationToken = default)
        {
            var restClient = GetGenericResourceContainer(resourceOperations);
            Pageable <GenericResourceExpanded> result;

            if (scopeFilter == null)
            {
                result = restClient.GetAll(resourceFilters?.ToString(), expand, top, cancellationToken);
            }
            else
            {
                result = restClient.GetByResourceGroup(
                    scopeFilter,
                    resourceFilters?.ToString(),
                    expand,
                    top,
                    cancellationToken);
            }

            return(result);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResourceContainer"/> class.
 /// </summary>
 /// <param name="parent"> The resource representing the parent resource. </param>
 protected ResourceContainer(ResourceOperations parent)
     : base(new ClientContext(parent.ClientOptions, parent.Credential, parent.BaseUri, parent.Pipeline), parent.Id)
 {
     Parent = parent;
 }
Beispiel #3
0
 private static GenericResourceContainer GetGenericResourceContainer(ResourceOperations resourceOperations)
 {
     return(new GenericResourceContainer(new ClientContext(resourceOperations.ClientOptions, resourceOperations.Credential, resourceOperations.BaseUri, resourceOperations.Pipeline), resourceOperations.Id));
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResourceOperations"/> class.
 /// </summary>
 /// <param name="parentOperations"> The resource representing the parent resource. </param>
 /// <param name="id"> The identifier of the resource that is the target of operations. </param>
 protected ResourceOperations(ResourceOperations parentOperations, ResourceIdentifier id)
     : this(new ClientContext(parentOperations.ClientOptions, parentOperations.Credential, parentOperations.BaseUri, parentOperations.Pipeline), id)
 {
 }