44using System . Net . Http ;
55using System . Threading . Tasks ;
66using Microsoft . Azure . WebJobs ;
7+ using Microsoft . Azure . WebJobs . Extensions . DurableTask ;
78using Microsoft . Azure . WebJobs . Extensions . Http ;
89using Microsoft . Extensions . Logging ;
910using Microsoft . WindowsAzure . Storage ;
@@ -32,21 +33,21 @@ public static class Orchestrator
3233 /// <returns></returns>
3334 [ FunctionName ( "Orchestrator_HttpStart" ) ]
3435 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 ,
3738 ILogger log )
3839 {
3940 // Function input comes from the request content.
40- string instanceId = await starter . StartNewAsync ( "Orchestrator" , "Nuget" ) ;
41+ string instanceId = await client . StartNewAsync ( "Orchestrator" , null , "Nuget" ) ;
4142
4243 log . LogInformation ( $ "Started orchestration with ID = '{ instanceId } '.") ;
4344
44- return starter . CreateCheckStatusResponse ( req , instanceId ) ;
45+ return client . CreateCheckStatusResponse ( req , instanceId ) ;
4546 }
4647
4748 [ FunctionName ( "Orchestrator" ) ]
4849 public static async Task < string > RunOrchestrator (
49- [ OrchestrationTrigger ] DurableOrchestrationContext context )
50+ [ OrchestrationTrigger ] IDurableOrchestrationContext context )
5051 {
5152 // retrieves the organization name from the Orchestrator_HttpStart function
5253 var organizationName = context . GetInput < string > ( ) ;
@@ -75,7 +76,7 @@ public static async Task<string> RunOrchestrator(
7576 }
7677
7778 [ 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 )
7980 {
8081 // retrieves the organization name from the Orchestrator function
8182 var organizationName = context . GetInput < string > ( ) ;
@@ -85,11 +86,11 @@ public static async Task<string> RunOrchestrator(
8586 }
8687
8788 [ 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 )
8990 {
9091 // retrieve a tuple of repositoryId and repository name from the Orchestrator function
9192 var parameters = context . GetInput < ( long id , string name ) > ( ) ;
92-
93+
9394 // retrieves a list of issues from a specific repository
9495 var issues = ( await github . Issue . GetAllForRepository ( parameters . id ) ) . ToList ( ) ;
9596
@@ -98,7 +99,7 @@ public static async Task<string> RunOrchestrator(
9899 }
99100
100101 [ FunctionName ( "SaveRepositories" ) ]
101- public static async Task SaveRepositories ( [ ActivityTrigger ] DurableActivityContext context )
102+ public static async Task SaveRepositories ( [ ActivityTrigger ] IDurableActivityContext context )
102103 {
103104 // retrieves a tuple from the Orchestrator function
104105 var parameters = context . GetInput < List < ( long id , int openedIssues , string name ) > > ( ) ;
0 commit comments