Skip to content

Commit b4b9c4a

Browse files
authored
Merge pull request #348 from aws-samples/dotnet-upgrade-to-net8
Upgrade to net8
2 parents 6ecbbbf + 50a36d1 commit b4b9c4a

File tree

101 files changed

+407
-446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+407
-446
lines changed

dotnet-test-samples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![.NET: 6.0](https://img.shields.io/badge/.NET-6.0-Green)](https://img.shields.io/badge/.NET-6.0-Green)
1+
[![.NET: 8.0](https://img.shields.io/badge/.NET-8.0-Green)](https://img.shields.io/badge/.NET-6.0-Green)
22

33
# .NET Test Samples
44

@@ -12,7 +12,7 @@ This portion of the repository contains code samples for testing serverless appl
1212
|[Hexagonal Architecture](./hexagonal-architecture)|An example of hexagonal architecture implemented using AWS Lambda with tests.|
1313
|[Kinesis Data Streams](./kinesis-lambda-dynamodb/)|This project contains unit and integration tests for a pattern using Kinesis Data Streams, AWS Lambda and Amazon DynamoDB.|
1414
|[SQS with AWS Lambda and DynamoDb](./sqs-lambda)|This project contains unit and integration tests for AWS Lambda that is invoked by Amazon Simple Queue Service (SQS)|
15-
|[Local testing using containers](./test-containers)|This pattern creates an Amazon API Gateway HTTP API, an AWS Lambda function, and a DynamoDB Table using SAM and .NET 6. It also demonstrates how you can use a local emulated version of DynamoDB to increase the speed of feedback loops as you make changes to your application code.|
15+
|[Local testing using containers](./test-containers)|This pattern creates an Amazon API Gateway HTTP API, an AWS Lambda function, and a DynamoDB Table using SAM and .NET 8. It also demonstrates how you can use a local emulated version of DynamoDB to increase the speed of feedback loops as you make changes to your application code.|
1616
|[Load Testing](./load-testing)|A description of how load testing can be carried out before deploying to production |
1717

1818
## Test Asynchronous Architectures

dotnet-test-samples/apigw-lambda-ddb/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![.NET: 6.0](https://img.shields.io/badge/.NET-6.0-Green)]()
1+
[![.NET: 8.0](https://img.shields.io/badge/.NET-8.0-Green)]()
22
[![AWS: Lambda](https://img.shields.io/badge/AWS-Lambda-blueviolet)]()
33
[![Amazon: Api Gateway](https://img.shields.io/badge/Amazon-API%20Gateway-blueviolet)]()
44
[![Amazon: DynamoDB](https://img.shields.io/badge/Amazon-DynamoDB-blueviolet)]()
@@ -10,12 +10,12 @@
1010

1111
### Description
1212

13-
This pattern creates an Amazon API Gateway HTTP API, an AWS Lambda function, and a DynamoDB Table using SAM and .NET 6.
13+
This pattern creates an Amazon API Gateway HTTP API, an AWS Lambda function, and a DynamoDB Table using SAM and .NET 8.
1414

1515
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage. Please see the AWS Pricing page for details. You are responsible for any AWS costs incurred.
1616

1717
## Language
18-
.NET 6
18+
.NET 8
1919

2020
## Framework
2121
The framework used to deploy the infrastructure is SAM
@@ -199,7 +199,7 @@ sam delete
199199
* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed and configured
200200
* [Git Installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
201201
* [AWS Serverless Application Model](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) (AWS SAM) installed
202-
* [.NET 6](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) installed
202+
* [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet) installed
203203

204204
## Video Walkthroughs
205205

dotnet-test-samples/apigw-lambda-ddb/src/DeleteProduct/DeleteProduct.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
66
<PublishReadyToRun>true</PublishReadyToRun>
77
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>

dotnet-test-samples/apigw-lambda-ddb/src/DeleteProduct/Function.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@ namespace DeleteProduct;
1919

2020
public class Function
2121
{
22-
private readonly IProductsDAO _dataAccess;
22+
private readonly IProductsDao _dataAccess;
2323
private readonly ILogger<Function> _logger;
2424

2525
public Function() : this(Startup.ServiceProvider) { }
2626

27-
public Function(IProductsDAO dataAccess, ILogger<Function> logger)
27+
public Function(IProductsDao dataAccess, ILogger<Function> logger)
2828
: this(NewServiceProvider(dataAccess, logger)) { }
2929

3030
private Function(IServiceProvider serviceProvider)
3131
{
32-
_dataAccess = serviceProvider.GetRequiredService<IProductsDAO>();
32+
_dataAccess = serviceProvider.GetRequiredService<IProductsDao>();
3333
_logger = serviceProvider.GetRequiredService<ILogger<Function>>();
3434
}
3535

36-
private static IServiceProvider NewServiceProvider(IProductsDAO dataAccess, ILogger<Function> logger)
36+
private static IServiceProvider NewServiceProvider(IProductsDao dataAccess, ILogger<Function> logger)
3737
{
3838
var container = new System.ComponentModel.Design.ServiceContainer();
3939

40-
container.AddService(typeof(IProductsDAO), dataAccess);
40+
container.AddService(typeof(IProductsDao), dataAccess);
4141
container.AddService(typeof(ILogger<Function>), logger);
4242

4343
return container;

dotnet-test-samples/apigw-lambda-ddb/src/DeleteProduct/aws-lambda-tools-defaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"region": "",
1010
"configuration": "Release",
1111
"function-architecture": "x86_64",
12-
"function-runtime": "dotnet6",
12+
"function-runtime": "dotnet8",
1313
"function-memory-size": 256,
1414
"function-timeout": 30,
1515
"function-handler": "DeleteProduct::DeleteProduct.Function::FunctionHandler"

dotnet-test-samples/apigw-lambda-ddb/src/GetProduct/Function.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,33 @@ namespace GetProduct;
1919

2020
public class Function
2121
{
22-
private readonly IProductsDAO _dataAccess;
22+
private readonly IProductsDao _dataAccess;
2323
private readonly IOptions<JsonSerializerOptions> _jsonOptions;
2424
private readonly ILogger<Function> _logger;
2525

2626
public Function() : this(Startup.ServiceProvider) { }
2727

2828
public Function(
29-
IProductsDAO dataAccess,
29+
IProductsDao dataAccess,
3030
ILogger<Function> logger,
3131
IOptions<JsonSerializerOptions> jsonOptions)
3232
: this(NewServiceProvider(dataAccess, logger, jsonOptions)) { }
3333

3434
private Function(IServiceProvider serviceProvider)
3535
{
36-
_dataAccess = serviceProvider.GetRequiredService<IProductsDAO>();
36+
_dataAccess = serviceProvider.GetRequiredService<IProductsDao>();
3737
_jsonOptions = serviceProvider.GetRequiredService<IOptions<JsonSerializerOptions>>();
3838
_logger = serviceProvider.GetRequiredService<ILogger<Function>>();
3939
}
4040

4141
private static IServiceProvider NewServiceProvider(
42-
IProductsDAO dataAccess,
42+
IProductsDao dataAccess,
4343
ILogger<Function> logger,
4444
IOptions<JsonSerializerOptions> jsonOptions)
4545
{
4646
var container = new System.ComponentModel.Design.ServiceContainer();
4747

48-
container.AddService(typeof(IProductsDAO), dataAccess);
48+
container.AddService(typeof(IProductsDao), dataAccess);
4949
container.AddService(typeof(IOptions<JsonSerializerOptions>), jsonOptions);
5050
container.AddService(typeof(ILogger<Function>), logger);
5151

dotnet-test-samples/apigw-lambda-ddb/src/GetProduct/GetProduct.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
66
<PublishReadyToRun>true</PublishReadyToRun>
77
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>

dotnet-test-samples/apigw-lambda-ddb/src/GetProduct/aws-lambda-tools-defaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"region": "",
1010
"configuration": "Release",
1111
"function-architecture": "x86_64",
12-
"function-runtime": "dotnet6",
12+
"function-runtime": "dotnet8",
1313
"function-memory-size": 256,
1414
"function-timeout": 30,
1515
"function-handler": "GetProduct::GetProduct.Function::FunctionHandler"

dotnet-test-samples/apigw-lambda-ddb/src/GetProducts/Function.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,33 @@ namespace GetProducts;
1919

2020
public class Function
2121
{
22-
private readonly IProductsDAO _dataAccess;
22+
private readonly IProductsDao _dataAccess;
2323
private readonly IOptions<JsonSerializerOptions> _jsonOptions;
2424
private readonly ILogger<Function> _logger;
2525

2626
public Function() : this(Startup.ServiceProvider) { }
2727

2828
public Function(
29-
IProductsDAO dataAccess,
29+
IProductsDao dataAccess,
3030
ILogger<Function> logger,
3131
IOptions<JsonSerializerOptions> jsonOptions)
3232
: this(NewServiceProvider(dataAccess, logger, jsonOptions)) { }
3333

3434
private Function(IServiceProvider serviceProvider)
3535
{
36-
_dataAccess = serviceProvider.GetRequiredService<IProductsDAO>();
36+
_dataAccess = serviceProvider.GetRequiredService<IProductsDao>();
3737
_jsonOptions = serviceProvider.GetRequiredService<IOptions<JsonSerializerOptions>>();
3838
_logger = serviceProvider.GetRequiredService<ILogger<Function>>();
3939
}
4040

4141
private static IServiceProvider NewServiceProvider(
42-
IProductsDAO dataAccess,
42+
IProductsDao dataAccess,
4343
ILogger<Function> logger,
4444
IOptions<JsonSerializerOptions> jsonOptions)
4545
{
4646
var container = new System.ComponentModel.Design.ServiceContainer();
4747

48-
container.AddService(typeof(IProductsDAO), dataAccess);
48+
container.AddService(typeof(IProductsDao), dataAccess);
4949
container.AddService(typeof(IOptions<JsonSerializerOptions>), jsonOptions);
5050
container.AddService(typeof(ILogger<Function>), logger);
5151

dotnet-test-samples/apigw-lambda-ddb/src/GetProducts/GetProducts.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
66
<PublishReadyToRun>true</PublishReadyToRun>
77
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>

0 commit comments

Comments
 (0)