File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
articles/azure-functions/durable Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,8 @@ public static async Task<string> ProcessOrder(
197
197
# [ C# (Isolated)] ( #tab/csharp-isolated )
198
198
199
199
``` csharp
200
+ using DurableTask .Core .Settings ;
201
+
200
202
[Function (" ProcessOrderOrchestrator" )]
201
203
public static async Task < string > ProcessOrder (
202
204
[OrchestrationTrigger ] TaskOrchestrationContext context )
@@ -205,12 +207,12 @@ public static async Task<string> ProcessOrder(
205
207
206
208
await context .CallActivityAsync (" ValidateOrder" , orderId );
207
209
208
- if (context .Version == " 1.0" )
210
+ if (VersioningSettings . CompareVersions ( context .Version , " 1.0" ) <= 0 )
209
211
{
210
212
// Preserve original logic for existing instances
211
213
await context .CallActivityAsync (" ProcessPayment" , orderId );
212
214
}
213
- else // version 2.0 and later
215
+ else // a higher version (including 2.0)
214
216
{
215
217
// New logic with discount processing (replaces payment processing)
216
218
await context .CallActivityAsync (" ApplyDiscount" , orderId );
You can’t perform that action at this time.
0 commit comments