-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14e2faa
commit 3e3a293
Showing
111 changed files
with
22,863 additions
and
18,505 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
// Use IntelliSense to find out which attributes exist for C# debugging | ||
// Use hover for the description of the existing attributes | ||
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md. | ||
"name": ".NET Core Launch (web)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
// If you have changed target frameworks, make sure to update the program path. | ||
"program": "${workspaceFolder}/backend/ASPNETCore/ASPNETCore.Web/bin/Debug/net7.0/ASPNETCore.Web.dll", | ||
"args": [], | ||
"cwd": "${workspaceFolder}/backend/ASPNETCore/ASPNETCore.Web", | ||
"stopAtEntry": false, | ||
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser | ||
"serverReadyAction": { | ||
"action": "openExternally", | ||
"pattern": "\\bNow listening on:\\s+(https?://\\S+)" | ||
}, | ||
"env": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"sourceFileMap": { | ||
"/Views": "${workspaceFolder}/Views" | ||
} | ||
}, | ||
{ | ||
"name": ".NET Core Attach", | ||
"type": "coreclr", | ||
"request": "attach" | ||
} | ||
] | ||
} |
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,28 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true, | ||
"source.fixAll.eslint": true | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[html]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[less]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"typescript.preferences.importModuleSpecifier": "relative" | ||
} |
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,41 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/backend/ASPNETCore/ASPNETCore.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/backend/ASPNETCore/ASPNETCore.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"watch", | ||
"run", | ||
"--project", | ||
"${workspaceFolder}/backend/ASPNETCore/ASPNETCore.sln" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
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,26 +1,68 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace ASPNETCore.Web | ||
using ASPNETCore.Extensions; | ||
using ASPNETCore.Repositories; | ||
using ASPNETCore.Web; | ||
using ASPNETCore.Web.MappingProfiles; | ||
using AspNetCoreAngularSignalR.Hubs; | ||
using AspNetCoreAngularSignalR.Repositories; | ||
using AspNetCoreAngularSignalR.Services; | ||
using Microsoft.AspNetCore.Mvc.ApiExplorer; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Options; | ||
using Newtonsoft.Json.Serialization; | ||
using Swashbuckle.AspNetCore.SwaggerGen; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
builder.Services.AddControllers() | ||
.AddNewtonsoftJson(options => | ||
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver()); | ||
|
||
builder.Services.AddEndpointsApiExplorer(); | ||
builder.Services.AddSwaggerGen(); | ||
|
||
builder.Services.AddCors(options => | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
options.AddPolicy("CorsPolicy", | ||
builder => | ||
{ | ||
CreateHostBuilder(args).Build().Run(); | ||
} | ||
|
||
public static IHostBuilder CreateHostBuilder(string[] args) => | ||
Host.CreateDefaultBuilder(args) | ||
.ConfigureWebHostDefaults(webBuilder => | ||
{ | ||
webBuilder.UseStartup<Startup>(); | ||
}); | ||
} | ||
builder | ||
.AllowAnyHeader() | ||
.AllowAnyMethod() | ||
.WithOrigins("http://localhost:4200") | ||
.AllowCredentials(); | ||
}); | ||
}); | ||
|
||
builder.Services.AddSingleton<IFoodRepository, FoodRepository>(); | ||
builder.Services.Configure<TimerServiceConfiguration>(builder.Configuration.GetSection("TimeService")); | ||
builder.Services.AddSingleton<IHostedService, SchedulerHostedService>(); | ||
|
||
builder.Services.AddRouting(options => options.LowercaseUrls = true); | ||
|
||
builder.Services.AddSignalR(); | ||
|
||
builder.Services.AddMappingProfiles(); | ||
|
||
builder.Services.AddDbContext<FoodDbContext>(opt => opt.UseInMemoryDatabase("FoodDb")); | ||
|
||
var app = builder.Build(); | ||
|
||
if (app.Environment.IsDevelopment()) | ||
{ | ||
app.UseDeveloperExceptionPage(); | ||
} | ||
var loggerFactory = app.Services.GetRequiredService<ILoggerFactory>(); | ||
|
||
app.UseSwagger(); | ||
app.UseSwaggerUI(); | ||
|
||
app.UseHttpsRedirection(); | ||
app.UseCors("CorsPolicy"); | ||
app.UseDefaultFiles(); | ||
app.UseStaticFiles(); | ||
app.UseRouting(); | ||
|
||
app.MapControllers(); | ||
app.MapHub<ChatHub>("/coolmessages"); | ||
|
||
app.Run(); |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.