diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/AutoRestDurationTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/AutoRestDurationTestService.cs
index 1e390935cb1b5..5568bf10d93c1 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/AutoRestDurationTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/AutoRestDurationTestService.cs
@@ -264,6 +264,10 @@ public AutoRestDurationTestService(Uri baseUri, ServiceClientCredentials credent
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -299,6 +303,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/AzureCompositeModel.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/AzureCompositeModel.cs
index 839f9cb24d260..264a98d8b5fa5 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/AzureCompositeModel.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/AzureCompositeModel.cs
@@ -305,6 +305,10 @@ public AzureCompositeModel(Uri baseUri, ServiceClientCredentials credentials, Ht
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -350,6 +354,7 @@ private void Initialize()
};
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("fishtype"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("fishtype"));
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
///
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/AutoRestParameterGroupingTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/AutoRestParameterGroupingTestService.cs
index fac44181bfb4d..ca2268fbab556 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/AutoRestParameterGroupingTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/AutoRestParameterGroupingTestService.cs
@@ -264,6 +264,10 @@ public AutoRestParameterGroupingTestService(Uri baseUri, ServiceClientCredential
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -299,6 +303,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureReport/AutoRestReportServiceForAzure.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureReport/AutoRestReportServiceForAzure.cs
index 9025219bc013e..03c2bc4366127 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureReport/AutoRestReportServiceForAzure.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureReport/AutoRestReportServiceForAzure.cs
@@ -259,6 +259,10 @@ public AutoRestReportServiceForAzure(Uri baseUri, ServiceClientCredentials crede
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -293,6 +297,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
///
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureResource/AutoRestResourceFlatteningTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureResource/AutoRestResourceFlatteningTestService.cs
index 5e3a7c82bf017..82fea546ef82c 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureResource/AutoRestResourceFlatteningTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureResource/AutoRestResourceFlatteningTestService.cs
@@ -259,6 +259,10 @@ public AutoRestResourceFlatteningTestService(Uri baseUri, ServiceClientCredentia
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -294,6 +298,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new TransformationJsonConverter());
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/AutoRestAzureSpecialParametersTestClient.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/AutoRestAzureSpecialParametersTestClient.cs
index d004c6aa329c2..049f0911e1d46 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/AutoRestAzureSpecialParametersTestClient.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/AutoRestAzureSpecialParametersTestClient.cs
@@ -311,6 +311,10 @@ public AutoRestAzureSpecialParametersTestClient(Uri baseUri, ServiceClientCreden
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -354,6 +358,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClient.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClient.cs
index 2dcce4d423978..fc03481d9dc29 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClient.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClient.cs
@@ -155,6 +155,10 @@ public AutoRestParameterizedHostTestClient(ServiceClientCredentials credentials,
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -191,6 +195,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Head/AutoRestHeadTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Head/AutoRestHeadTestService.cs
index 1cb027227a7c1..05b0dd03b4d49 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Head/AutoRestHeadTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Head/AutoRestHeadTestService.cs
@@ -263,6 +263,10 @@ public AutoRestHeadTestService(Uri baseUri, ServiceClientCredentials credentials
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -298,6 +302,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/HeadExceptions/AutoRestHeadExceptionTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/HeadExceptions/AutoRestHeadExceptionTestService.cs
index 8d6d1511f55e5..d4d73ccad957a 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/HeadExceptions/AutoRestHeadExceptionTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/HeadExceptions/AutoRestHeadExceptionTestService.cs
@@ -263,6 +263,10 @@ public AutoRestHeadExceptionTestService(Uri baseUri, ServiceClientCredentials cr
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -298,6 +302,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/AutoRestLongRunningOperationTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/AutoRestLongRunningOperationTestService.cs
index 52624e5848260..e2cfb05d003e4 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/AutoRestLongRunningOperationTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/AutoRestLongRunningOperationTestService.cs
@@ -279,6 +279,10 @@ public AutoRestLongRunningOperationTestService(Uri baseUri, ServiceClientCredent
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -318,6 +322,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new TransformationJsonConverter());
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/AutoRestPagingTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/AutoRestPagingTestService.cs
index 96e491913b228..5f18e4bc512bb 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/AutoRestPagingTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/AutoRestPagingTestService.cs
@@ -264,6 +264,10 @@ public AutoRestPagingTestService(Uri baseUri, ServiceClientCredentials credentia
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -299,6 +303,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/MicrosoftAzureTestUrl.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/MicrosoftAzureTestUrl.cs
index deead47817e8f..7dcd841caa0e2 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/MicrosoftAzureTestUrl.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/MicrosoftAzureTestUrl.cs
@@ -274,6 +274,10 @@ public MicrosoftAzureTestUrl(Uri baseUri, ServiceClientCredentials credentials,
}
}
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
///
/// Initializes client properties.
///
@@ -310,6 +314,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
+ CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp/Templates/AzureServiceClientTemplate.cshtml b/AutoRest/Generators/CSharp/Azure.CSharp/Templates/AzureServiceClientTemplate.cshtml
index 107453541e9ad..b9aa0bfd38024 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp/Templates/AzureServiceClientTemplate.cshtml
+++ b/AutoRest/Generators/CSharp/Azure.CSharp/Templates/AzureServiceClientTemplate.cshtml
@@ -38,6 +38,11 @@ namespace @Settings.Namespace
{
@(Include(new ServiceClientBodyTemplate(), (ServiceClientTemplateModel)Model))
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
+
///
/// Initializes client properties.
///
@@ -97,6 +102,8 @@ namespace @Settings.Namespace
@:DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<@(polymorphicType.Name)>("@(polymorphicType.PolymorphicDiscriminator)"));
}
+ CustomInitialize();
+
@if (Model.NeedsTransformationConverter)
{
@:DeserializationSettings.Converters.Add(new TransformationJsonConverter());