Updates for .NET 6. Ran successfully locally (#333)
This commit is contained in:
Родитель
1128a69712
Коммит
c7be0f94c4
|
@ -25,9 +25,11 @@ namespace SampleFunctionApp
|
|||
dynamic data = JsonConvert.DeserializeObject(requestBody);
|
||||
name = name ?? data?.name;
|
||||
|
||||
return name != null
|
||||
? (ActionResult)new OkObjectResult($"Hello {name}! Welcome to Azure Functions!")
|
||||
: (ActionResult)new OkObjectResult("Hello there! Welcome to Azure Functions!");
|
||||
string responseMessage = string.IsNullOrEmpty(name)
|
||||
? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
|
||||
: $"Hello, {name}. This HTTP triggered function executed successfully.";
|
||||
|
||||
return new OkObjectResult(responseMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="host.json">
|
||||
|
|
Загрузка…
Ссылка в новой задаче