Microsoft.Azure.Commands.Common.Authentication.Models.JsonProfileSerializer.Serialize C# (CSharp) Method

Serialize() public method

public Serialize ( AzureSMProfile profile ) : string
profile AzureSMProfile
return string
        public string Serialize(AzureSMProfile profile)
        {
            return JsonConvert.SerializeObject(new
            {
                Environments = profile.Environments.Values.ToList(),
                Subscriptions = profile.Subscriptions.Values.ToList(),
                Accounts = profile.Accounts.Values.ToList()
            }, Formatting.Indented);
        }

Usage Example

Example #1
0
 public override string ToString()
 {
     JsonProfileSerializer jsonSerializer = new JsonProfileSerializer();
     return jsonSerializer.Serialize(this);
 }
All Usage Examples Of Microsoft.Azure.Commands.Common.Authentication.Models.JsonProfileSerializer::Serialize
JsonProfileSerializer