Skip to content

Commit 4637687

Browse files
committed
clean
1 parent 39443d6 commit 4637687

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

samples/CommandQuery.Sample.AWSLambda/Command.cs

+3-10
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,10 @@
66

77
namespace CommandQuery.Sample.AWSLambda;
88

9-
public class Command
9+
public class Command(ICommandFunction commandFunction)
1010
{
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]
1912
[RestApi(LambdaHttpMethod.Post, "/command/{commandName}")]
2013
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);
2215
}

samples/CommandQuery.Sample.AWSLambda/Properties/launchSettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
"executablePath": "%USERPROFILE%\\.dotnet\\tools\\dotnet-lambda-test-tool-8.0.exe"
99
}
1010
}
11-
}
11+
}

samples/CommandQuery.Sample.AWSLambda/Query.cs

+5-12
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,16 @@
66

77
namespace CommandQuery.Sample.AWSLambda
88
{
9-
public class Query
9+
public class Query(IQueryFunction queryFunction)
1010
{
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]
1912
[RestApi(LambdaHttpMethod.Get, "/query/{queryName}")]
2013
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);
2215

23-
[LambdaFunction(Policies = "AWSLambdaBasicExecutionRole", MemorySize = 256, Timeout = 30)]
16+
[LambdaFunction]
2417
[RestApi(LambdaHttpMethod.Post, "/query/{queryName}")]
2518
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);
2720
}
2821
}

0 commit comments

Comments
 (0)