Skip to content

Commit de68bcb

Browse files
committed
update code to use the isolated model example
Signed-off-by: Hannah Hunter <[email protected]>
1 parent 95d6787 commit de68bcb

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

articles/azure-functions/durable/durable-functions-orchestrations.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,27 +408,37 @@ It isn't possible to pass multiple parameters to an activity function directly.
408408

409409
# [C# (InProc)](#tab/csharp-inproc)
410410

411-
In .NET, you can also use [ValueTuple](/dotnet/csharp/language-reference/builtin-types/value-tuples) objects to pass multiple parameters. The following sample uses [ValueTuple](/dotnet/csharp/language-reference/builtin-types/value-tuples) features added with [C# 7](/dotnet/csharp/whats-new/csharp-version-history#c-version-70):
411+
In .NET, you can use a class to pass multiple parameters:
412412

413413
```csharp
414+
public class CourseInfo
415+
{
416+
public string Major { get; set; }
417+
public int UniversityYear { get; set; }
418+
}
419+
414420
[FunctionName("GetCourseRecommendations")]
415421
public static async Task<object> RunOrchestrator(
416422
[OrchestrationTrigger] IDurableOrchestrationContext context)
417423
{
418-
string major = "ComputerScience";
419424
int universityYear = context.GetInput<int>();
425+
CourseInfo courseInfo = new CourseInfo
426+
{
427+
Major = "ComputerScience",
428+
UniversityYear = universityYear
429+
};
420430

421431
object courseRecommendations = await context.CallActivityAsync<object>(
422432
"CourseRecommendations",
423-
(major, universityYear));
433+
courseInfo);
424434
return courseRecommendations;
425435
}
426436

427437
[FunctionName("CourseRecommendations")]
428438
public static async Task<object> Mapper([ActivityTrigger] IDurableActivityContext inputs)
429439
{
430440
// Parse the input for the student's major and year in university.
431-
(string Major, int UniversityYear) studentInfo = inputs.GetInput<(string, int)>();
441+
CourseInfo studentInfo = inputs.GetInput<CourseInfo>();
432442

433443
// Retrieve and return course recommendations by major and university year.
434444
return new

0 commit comments

Comments
 (0)