forked from serverless/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update
.net
examples to .NET 6 (serverless#682)
- Loading branch information
Showing
9 changed files
with
47 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
using Amazon.Lambda.Core; | ||
|
||
[assembly:LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] | ||
namespace AwsDotnetCsharp | ||
|
||
namespace AwsDotnetCsharp; | ||
public class Handler | ||
{ | ||
public class Handler | ||
public Response Hello(Request request) | ||
{ | ||
public Response Hello(Request request) | ||
{ | ||
return new Response("Go Serverless v1.0! Your function executed successfully!", request); | ||
} | ||
return new Response("Go Serverless v1.0! Your function executed successfully!", request); | ||
} | ||
} | ||
|
||
public class Response | ||
{ | ||
public string Message {get; set;} | ||
public Request Request {get; set;} | ||
public class Response | ||
{ | ||
public string Message {get; set;} | ||
public Request Request {get; set;} | ||
|
||
public Response(string message, Request request){ | ||
Message = message; | ||
Request = request; | ||
} | ||
} | ||
public Response(string message, Request request) | ||
{ | ||
Message = message; | ||
Request = request; | ||
} | ||
} | ||
|
||
public class Request | ||
{ | ||
public string Key1 {get; set;} | ||
public string Key2 {get; set;} | ||
public string Key3 {get; set;} | ||
} | ||
public class Request | ||
{ | ||
public string Key1 {get; set;} | ||
public string Key2 {get; set;} | ||
public string Key3 {get; set;} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<AssemblyName>CsharpHandlers</AssemblyName> | ||
<PackageId>aws-csharp</PackageId> | ||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> | ||
<PublishReadyToRun>true</PublishReadyToRun> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" /> | ||
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.0.1" /> | ||
<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" /> | ||
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.2.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="Amazon.Lambda.Core" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dotnet restore | ||
dotnet tool install -g Amazon.Lambda.Tools --framework netcoreapp3.1 | ||
dotnet lambda package --configuration Release --framework netcoreapp3.1 --output-package bin/Release/netcoreapp3.1/hello.zip | ||
dotnet tool install -g Amazon.Lambda.Tools --framework net6.0 | ||
dotnet lambda package --configuration Release --framework net6.0 --output-package bin/Release/net6.0/hello.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<AssemblyName>FsharpHandlers</AssemblyName> | ||
<PackageId>aws-fsharp</PackageId> | ||
<PublishReadyToRun>true</PublishReadyToRun> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="Handler.fs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" /> | ||
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.0.1" /> | ||
<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" /> | ||
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.2.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
dotnet restore | ||
dotnet tool install -g Amazon.Lambda.Tools --framework netcoreapp3.1 | ||
dotnet tool install -g Amazon.Lambda.Tools --framework net6.0 | ||
|
||
dotnet lambda package --configuration Release --framework netcoreapp3.1 --output-package bin/Release/netcoreapp3.1/deploy-package.zip | ||
dotnet lambda package --configuration Release --framework net6.0 --output-package bin/Release/net6.0/deploy-package.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters