From f3c93e5c41682bd4be3874c75bd7bbcebf5ddd13 Mon Sep 17 00:00:00 2001 From: Mike Minutillo Date: Tue, 10 Aug 2021 16:43:26 +0800 Subject: [PATCH 1/2] Deprecate static hosting method --- .../ServiceBusTriggeredEndpointConfiguration.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs index fe605334..957b1469 100644 --- a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs +++ b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs @@ -131,6 +131,10 @@ static string GetConfiguredValueOrFallback(IConfiguration configuration, string /// Attempts to derive the required configuration parameters automatically from the Azure Functions related attributes via /// reflection. /// + [ObsoleteEx( + Message = "The static hosting model has been deprecated. Refer to the documentation for details on how to use class-instance approach instead.", + RemoveInVersion = "3", + TreatAsErrorFromVersion = "2")] public static ServiceBusTriggeredEndpointConfiguration FromAttributes() { var serviceBusTriggerAttribute = ReflectionHelper.FindBusTriggerAttribute(); From 37e95897ae48d1c88ecafe5f7ee1a45a603e6770 Mon Sep 17 00:00:00 2001 From: Tim Bussmann Date: Tue, 10 Aug 2021 13:25:52 +0200 Subject: [PATCH 2/2] approve API changes --- .../ApprovalFiles/APIApprovals.Approve.approved.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ServiceBus.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt b/src/ServiceBus.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt index 625ba113..750c7ecf 100644 --- a/src/ServiceBus.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt +++ b/src/ServiceBus.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt @@ -84,6 +84,9 @@ namespace NServiceBus where T : NServiceBus.Serialization.SerializationDefinition, new () { } protected NServiceBus.TransportExtensions UseTransport() where TTransport : NServiceBus.Transport.TransportDefinition, new () { } + [System.Obsolete("The static hosting model has been deprecated. Refer to the documentation for deta" + + "ils on how to use class-instance approach instead. Will be treated as an error f" + + "rom version 2.0.0. Will be removed in version 3.0.0.", false)] public static NServiceBus.ServiceBusTriggeredEndpointConfiguration FromAttributes() { } } } \ No newline at end of file