Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public partial interface IStorageManagementClient : System.IDisposable
/// <summary>
/// Gets or sets json serialization settings.
/// </summary>
Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }
JsonSerializerSettings SerializationSettings { get; }

/// <summary>
/// Gets or sets json deserialization settings.
/// </summary>
Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }
JsonSerializerSettings DeserializationSettings { get; }

/// <summary>
/// Credentials needed for the client to connect to Azure.
Expand Down
2 changes: 1 addition & 1 deletion Samples/azure-storage/Azure.CSharp/Models/AccountStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Petstore.Models
/// <summary>
/// Defines values for AccountStatus.
/// </summary>
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
[JsonConverter(typeof(StringEnumConverter))]
public enum AccountStatus
{
[EnumMember(Value = "Available")]
Expand Down
2 changes: 1 addition & 1 deletion Samples/azure-storage/Azure.CSharp/Models/AccountType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Petstore.Models
/// <summary>
/// Defines values for AccountType.
/// </summary>
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
[JsonConverter(typeof(StringEnumConverter))]
public enum AccountType
{
[EnumMember(Value = "Standard_LRS")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Petstore.Models
/// <summary>
/// Defines values for ProvisioningState.
/// </summary>
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
[JsonConverter(typeof(StringEnumConverter))]
public enum ProvisioningState
{
[EnumMember(Value = "Creating")]
Expand Down
2 changes: 1 addition & 1 deletion Samples/azure-storage/Azure.CSharp/Models/Reason.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Petstore.Models
/// <summary>
/// Defines values for Reason.
/// </summary>
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
[JsonConverter(typeof(StringEnumConverter))]
public enum Reason
{
[EnumMember(Value = "AccountNameInvalid")]
Expand Down
2 changes: 1 addition & 1 deletion Samples/azure-storage/Azure.CSharp/Models/UsageUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Petstore.Models
/// <summary>
/// Defines values for UsageUnit.
/// </summary>
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
[JsonConverter(typeof(StringEnumConverter))]
public enum UsageUnit
{
[EnumMember(Value = "Count")]
Expand Down
50 changes: 34 additions & 16 deletions Samples/azure-storage/Azure.CSharp/StorageAccountsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -183,7 +185,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -220,7 +222,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<CheckNameAvailabilityResult>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down Expand Up @@ -371,6 +373,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -554,6 +558,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -601,7 +607,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -638,7 +644,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<StorageAccount>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down Expand Up @@ -781,6 +787,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -834,7 +842,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -871,7 +879,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<StorageAccount>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down Expand Up @@ -992,6 +1000,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -1039,7 +1049,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -1076,7 +1086,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<StorageAccountKeys>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down Expand Up @@ -1169,6 +1179,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -1216,7 +1228,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -1253,7 +1265,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<StorageAccount>>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down Expand Up @@ -1356,6 +1368,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -1403,7 +1417,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -1440,7 +1454,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<StorageAccount>>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down Expand Up @@ -1576,6 +1590,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -1629,7 +1645,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -1666,7 +1682,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<StorageAccountKeys>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down Expand Up @@ -1805,6 +1821,8 @@ internal StorageAccountsOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -1858,7 +1876,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -1895,7 +1913,7 @@ internal StorageAccountsOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<StorageAccount>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down
30 changes: 15 additions & 15 deletions Samples/azure-storage/Azure.CSharp/StorageManagementClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public partial class StorageManagementClient : ServiceClient<StorageManagementCl
/// <summary>
/// Gets or sets json serialization settings.
/// </summary>
public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; }
public JsonSerializerSettings SerializationSettings { get; private set; }

/// <summary>
/// Gets or sets json deserialization settings.
/// </summary>
public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; }
public JsonSerializerSettings DeserializationSettings { get; private set; }

/// <summary>
/// Credentials needed for the client to connect to Azure.
Expand Down Expand Up @@ -284,27 +284,27 @@ private void Initialize()
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings
SerializationSettings = new JsonSerializerSettings
{
Formatting = Newtonsoft.Json.Formatting.Indented,
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
Formatting = Formatting.Indented,
DateFormatHandling = DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
NullValueHandling = NullValueHandling.Ignore,
ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
ContractResolver = new ReadOnlyJsonContractResolver(),
Converters = new System.Collections.Generic.List<Newtonsoft.Json.JsonConverter>
Converters = new List<JsonConverter>
{
new Iso8601TimeSpanConverter()
}
};
DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings
DeserializationSettings = new JsonSerializerSettings
{
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
DateFormatHandling = DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
NullValueHandling = NullValueHandling.Ignore,
ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
ContractResolver = new ReadOnlyJsonContractResolver(),
Converters = new System.Collections.Generic.List<Newtonsoft.Json.JsonConverter>
Converters = new List<JsonConverter>
{
new Iso8601TimeSpanConverter()
}
Expand Down
6 changes: 4 additions & 2 deletions Samples/azure-storage/Azure.CSharp/UsageOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ internal UsageOperations(StorageManagementClient client)
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}


if (customHeaders != null)
{
foreach(var _header in customHeaders)
Expand Down Expand Up @@ -164,7 +166,7 @@ internal UsageOperations(StorageManagementClient client)
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
catch (JsonException)
{
// Ignore the exception
}
Expand Down Expand Up @@ -201,7 +203,7 @@ internal UsageOperations(StorageManagementClient client)
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<Usage>>(_responseContent, Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
Expand Down
4 changes: 2 additions & 2 deletions Samples/petstore/CSharp/ISwaggerPetstore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public partial interface ISwaggerPetstore : System.IDisposable
/// <summary>
/// Gets or sets json serialization settings.
/// </summary>
Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }
JsonSerializerSettings SerializationSettings { get; }

/// <summary>
/// Gets or sets json deserialization settings.
/// </summary>
Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }
JsonSerializerSettings DeserializationSettings { get; }


/// <summary>
Expand Down
Loading