4
4
using System . Net . Http ;
5
5
using System . Threading . Tasks ;
6
6
using Microsoft . Azure . WebJobs ;
7
+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
7
8
using Microsoft . Azure . WebJobs . Extensions . Http ;
8
9
using Microsoft . Extensions . Logging ;
9
10
using Microsoft . WindowsAzure . Storage ;
@@ -32,21 +33,21 @@ public static class Orchestrator
32
33
/// <returns></returns>
33
34
[ FunctionName ( "Orchestrator_HttpStart" ) ]
34
35
public static async Task < HttpResponseMessage > HttpStart (
35
- [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" , "post" ) ] HttpRequestMessage req ,
36
- [ OrchestrationClient ] DurableOrchestrationClient starter ,
36
+ [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" , "post" ) ] HttpRequestMessage req ,
37
+ [ DurableClient ] IDurableOrchestrationClient client ,
37
38
ILogger log )
38
39
{
39
40
// Function input comes from the request content.
40
- string instanceId = await starter . StartNewAsync ( "Orchestrator" , "Nuget" ) ;
41
+ string instanceId = await client . StartNewAsync ( "Orchestrator" , null , "Nuget" ) ;
41
42
42
43
log . LogInformation ( $ "Started orchestration with ID = '{ instanceId } '.") ;
43
44
44
- return starter . CreateCheckStatusResponse ( req , instanceId ) ;
45
+ return client . CreateCheckStatusResponse ( req , instanceId ) ;
45
46
}
46
47
47
48
[ FunctionName ( "Orchestrator" ) ]
48
49
public static async Task < string > RunOrchestrator (
49
- [ OrchestrationTrigger ] DurableOrchestrationContext context )
50
+ [ OrchestrationTrigger ] IDurableOrchestrationContext context )
50
51
{
51
52
// retrieves the organization name from the Orchestrator_HttpStart function
52
53
var organizationName = context . GetInput < string > ( ) ;
@@ -75,7 +76,7 @@ public static async Task<string> RunOrchestrator(
75
76
}
76
77
77
78
[ FunctionName ( "GetAllRepositoriesForOrganization" ) ]
78
- public static async Task < List < ( long id , string name ) > > GetAllRepositoriesForOrganization ( [ ActivityTrigger ] DurableActivityContext context )
79
+ public static async Task < List < ( long id , string name ) > > GetAllRepositoriesForOrganization ( [ ActivityTrigger ] IDurableActivityContext context )
79
80
{
80
81
// retrieves the organization name from the Orchestrator function
81
82
var organizationName = context . GetInput < string > ( ) ;
@@ -85,11 +86,11 @@ public static async Task<string> RunOrchestrator(
85
86
}
86
87
87
88
[ FunctionName ( "GetOpenedIssues" ) ]
88
- public static async Task < ( long id , int openedIssues , string name ) > GetOpenedIssues ( [ ActivityTrigger ] DurableActivityContext context )
89
+ public static async Task < ( long id , int openedIssues , string name ) > GetOpenedIssues ( [ ActivityTrigger ] IDurableActivityContext context )
89
90
{
90
91
// retrieve a tuple of repositoryId and repository name from the Orchestrator function
91
92
var parameters = context . GetInput < ( long id , string name ) > ( ) ;
92
-
93
+
93
94
// retrieves a list of issues from a specific repository
94
95
var issues = ( await github . Issue . GetAllForRepository ( parameters . id ) ) . ToList ( ) ;
95
96
@@ -98,7 +99,7 @@ public static async Task<string> RunOrchestrator(
98
99
}
99
100
100
101
[ FunctionName ( "SaveRepositories" ) ]
101
- public static async Task SaveRepositories ( [ ActivityTrigger ] DurableActivityContext context )
102
+ public static async Task SaveRepositories ( [ ActivityTrigger ] IDurableActivityContext context )
102
103
{
103
104
// retrieves a tuple from the Orchestrator function
104
105
var parameters = context . GetInput < List < ( long id , int openedIssues , string name ) > > ( ) ;
0 commit comments