예제 #1
0
    public Task <TAzureResource> GetResourceAsync <TAzureResource>(string resourceId, bool throwIfNotExists = false)
        where TAzureResource : AzureResource
    {
        var bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
        var resource     = Activator.CreateInstance(typeof(TAzureResource), bindingFlags, null, new object[] { resourceId }, CultureInfo.InvariantCulture) as TAzureResource;

        return(AzureResource.InitializeAsync(resource, this, throwIfNotExists));
    }
예제 #2
0
 public Task <AzureResourceGroup> GetResourceGroupAsync(Guid subscriptionId, string resourceGroupName, bool throwIfNotExists = false)
 => AzureResource.InitializeAsync(new AzureResourceGroup(subscriptionId, resourceGroupName), this, throwIfNotExists);
예제 #3
0
 public Task <AzureResource> GetResourceAsync(string resourceId, bool throwIfNotExists = false)
 => AzureResource.InitializeAsync(new AzureResource(resourceId), this, throwIfNotExists);
예제 #4
0
 public Task <AzureSubscription> GetSubscriptionAsync(Guid subscriptionId, bool throwIfNotExists = false)
 => AzureResource.InitializeAsync(new AzureSubscription(subscriptionId), this, throwIfNotExists);