-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from nventive/feature/net7
feat: Upgrades to net7.0
- Loading branch information
Showing
25 changed files
with
147 additions
and
157 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
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,5 +1,5 @@ | ||
{ | ||
"sdk": { | ||
"version": "6.0.407" | ||
"version": "7.0.305" | ||
} | ||
} |
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
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
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
26 changes: 12 additions & 14 deletions
26
src/Content/Backend/NV.Templates.Backend.Functions/GeneralFunctions.cs
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,40 +1,38 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using System.IO; | ||
using System.Net; | ||
using System.Text; | ||
using System.Text.Json; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Azure.WebJobs; | ||
using Microsoft.Azure.WebJobs.Extensions.Http; | ||
using Microsoft.Azure.Functions.Worker; | ||
using Microsoft.Azure.Functions.Worker.Http; | ||
using Newtonsoft.Json; | ||
|
||
namespace NV.Templates.Backend.Functions | ||
{ | ||
public class GeneralFunctions | ||
{ | ||
private readonly IApplicationInfo _applicationInfo; | ||
private readonly IOperationContext _operationContext; | ||
|
||
public GeneralFunctions( | ||
IApplicationInfo applicationInfo, | ||
IOperationContext operationContext) | ||
IApplicationInfo applicationInfo) | ||
{ | ||
_applicationInfo = applicationInfo; | ||
_operationContext = operationContext; | ||
} | ||
|
||
/// <summary> | ||
/// Get System Information. | ||
/// </summary> | ||
[FunctionName("GetInfo")] | ||
public async Task<JsonResult> GetInfo( | ||
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "info")] HttpRequest request, | ||
ExecutionContext executionContext) | ||
[Function("GetInfo")] | ||
public async Task<IActionResult> GetInfo( | ||
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "info")] HttpRequest request, FunctionContext context) | ||
{ | ||
if (request == null) | ||
{ | ||
throw new ArgumentNullException(nameof(request)); | ||
} | ||
|
||
_operationContext.Id = executionContext?.InvocationId.ToString() ?? $"{Guid.NewGuid()}"; | ||
return new JsonResult(_applicationInfo) { StatusCode = StatusCodes.Status200OK }; | ||
return new JsonResult(_applicationInfo); | ||
} | ||
} | ||
} |
16 changes: 12 additions & 4 deletions
16
src/Content/Backend/NV.Templates.Backend.Functions/NV.Templates.Backend.Functions.csproj
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
23 changes: 23 additions & 0 deletions
23
src/Content/Backend/NV.Templates.Backend.Functions/Program.cs
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.Azure.Functions.Worker; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
|
||
var host = new HostBuilder() | ||
.ConfigureFunctionsWebApplication() | ||
.ConfigureServices(services => | ||
{ | ||
var rootProjectPath = Path.GetFullPath(Path.Combine("..", "..", "..", "..")); | ||
var hostingEnvironment = services.BuildServiceProvider().GetService<IHostEnvironment>(); | ||
var configuration = new ConfigurationBuilder() | ||
.AddLocalSettings(rootProjectPath) | ||
.AddAzureKeyVaultWhenPresent(hostingEnvironment!) | ||
.AddEnvironmentVariables() | ||
.AddUserSecrets<Program>(true) | ||
.Build(); | ||
services.AddSingleton(configuration); | ||
services.AddCore(configuration); | ||
}) | ||
.Build(); | ||
|
||
await host.RunAsync(); |
9 changes: 9 additions & 0 deletions
9
src/Content/Backend/NV.Templates.Backend.Functions/Properties/launchSettings.json
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"profiles": { | ||
"NV.Templates.Backend.Functions": { | ||
"commandName": "Project", | ||
"commandLineArgs": "--port 7096", | ||
"launchBrowser": false | ||
} | ||
} | ||
} |
Oops, something went wrong.