// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.SqlTools.ResourceProvider.Core.Authentication; namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl { /// /// Implementation for using VS services /// Contains information about an Azure subscription /// public class AzureSubscriptionContext : IAzureSubscriptionContext { private readonly IAzureSubscriptionIdentifier _azureSubscriptionIdentifier; /// /// Default constructor to initialize the subscription /// public AzureSubscriptionContext(IAzureSubscriptionIdentifier azureSubscriptionIdentifier) { _azureSubscriptionIdentifier = azureSubscriptionIdentifier; } /// /// Returns true if given subscription equals this class /// public bool Equals(IAzureSubscriptionContext other) { return (other == null && Subscription == null) || (other != null && other.Subscription.Equals(Subscription)); } /// /// Returns the wraper for the subscription identifier /// public IAzureSubscriptionIdentifier Subscription { get { return _azureSubscriptionIdentifier; } } /// /// Returns subscription name /// public string SubscriptionName { get { return _azureSubscriptionIdentifier != null ? _azureSubscriptionIdentifier.SubscriptionId : string.Empty; } } } }