File tree 3 files changed +9
-23
lines changed
samples/CommandQuery.Sample.AWSLambda
3 files changed +9
-23
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace CommandQuery . Sample . AWSLambda ;
8
8
9
- public class Command
9
+ public class Command ( ICommandFunction commandFunction )
10
10
{
11
- private readonly ICommandFunction _commandFunction ;
12
-
13
- public Command ( ICommandFunction commandFunction )
14
- {
15
- _commandFunction = commandFunction ;
16
- }
17
-
18
- [ LambdaFunction ( Policies = "AWSLambdaBasicExecutionRole" , MemorySize = 256 , Timeout = 30 ) ]
11
+ [ LambdaFunction ]
19
12
[ RestApi ( LambdaHttpMethod . Post , "/command/{commandName}" ) ]
20
13
public async Task < APIGatewayProxyResponse > Handle ( APIGatewayProxyRequest request , ILambdaContext context , string commandName ) =>
21
- await _commandFunction . HandleAsync ( commandName , request , context . Logger ) ;
14
+ await commandFunction . HandleAsync ( commandName , request , context . Logger ) ;
22
15
}
Original file line number Diff line number Diff line change 8
8
"executablePath" : " %USERPROFILE%\\ .dotnet\\ tools\\ dotnet-lambda-test-tool-8.0.exe"
9
9
}
10
10
}
11
- }
11
+ }
Original file line number Diff line number Diff line change 6
6
7
7
namespace CommandQuery . Sample . AWSLambda
8
8
{
9
- public class Query
9
+ public class Query ( IQueryFunction queryFunction )
10
10
{
11
- private readonly IQueryFunction _queryFunction ;
12
-
13
- public Query ( IQueryFunction queryFunction )
14
- {
15
- _queryFunction = queryFunction ;
16
- }
17
-
18
- [ LambdaFunction ( Policies = "AWSLambdaBasicExecutionRole" , MemorySize = 256 , Timeout = 30 ) ]
11
+ [ LambdaFunction ]
19
12
[ RestApi ( LambdaHttpMethod . Get , "/query/{queryName}" ) ]
20
13
public async Task < APIGatewayProxyResponse > Get ( APIGatewayProxyRequest request , ILambdaContext context , string queryName ) =>
21
- await _queryFunction . HandleAsync ( queryName , request , context . Logger ) ;
14
+ await queryFunction . HandleAsync ( queryName , request , context . Logger ) ;
22
15
23
- [ LambdaFunction ( Policies = "AWSLambdaBasicExecutionRole" , MemorySize = 256 , Timeout = 30 ) ]
16
+ [ LambdaFunction ]
24
17
[ RestApi ( LambdaHttpMethod . Post , "/query/{queryName}" ) ]
25
18
public async Task < APIGatewayProxyResponse > Post ( APIGatewayProxyRequest request , ILambdaContext context , string queryName ) =>
26
- await _queryFunction . HandleAsync ( queryName , request , context . Logger ) ;
19
+ await queryFunction . HandleAsync ( queryName , request , context . Logger ) ;
27
20
}
28
21
}
You can’t perform that action at this time.
0 commit comments