aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/Program.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-12-30 20:22:55 +0100
committerivarlovlie <git@ivarlovlie.no>2022-12-30 20:22:55 +0100
commit3c188c2949af9d0e08db74a850f8a87dad52de49 (patch)
tree5dba85786aa9a5a72d91328092a017f16318b8c0 /code/api/Program.cs
parentf5374b0b3543b0bd7d280f71ed8bf5175bad3834 (diff)
downloadstorage-3c188c2949af9d0e08db74a850f8a87dad52de49.tar.xz
storage-3c188c2949af9d0e08db74a850f8a87dad52de49.zip
feat: Yes
Diffstat (limited to 'code/api/Program.cs')
-rw-r--r--code/api/Program.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/code/api/Program.cs b/code/api/Program.cs
index 5fde778..f6c0fae 100644
--- a/code/api/Program.cs
+++ b/code/api/Program.cs
@@ -1,4 +1,5 @@
global using Microsoft.AspNetCore.Mvc;
+global using I2R.Storage.Api.Services.System;
global using IOL.Helpers;
global using I2R.Storage.Api.Services.Admin;
global using Microsoft.AspNetCore.Mvc.RazorPages;
@@ -13,6 +14,10 @@ global using I2R.Storage.Api.Statics;
global using Microsoft.AspNetCore.Authorization;
global using System.Security.Claims;
global using I2R.Storage.Api.Models;
+global using MR.AspNetCore.Pagination;
+global using MR.EntityFrameworkCore.KeysetPagination;
+global using System.Text.Json;
+using I2R.Storage.Api.Services.System;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Localization;
@@ -32,6 +37,9 @@ builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationSc
builder.Services.AddLocalization();
builder.Services.AddRequestLocalization(o => { o.DefaultRequestCulture = new RequestCulture("en"); });
builder.Services.AddScoped<UserService>();
+builder.Services.AddScoped<StorageService>();
+builder.Services.AddScoped<ShareService>();
+builder.Services.AddScoped<DefaultResourceService>();
builder.Services.AddDbContext<AppDatabase>(o => {
o.UseNpgsql(builder.Configuration.GetAppDbConnectionString(), b => {
b.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
@@ -39,6 +47,7 @@ builder.Services.AddDbContext<AppDatabase>(o => {
});
o.UseSnakeCaseNamingConvention();
});
+builder.Services.AddPagination();
builder.Services.AddRazorPages().AddRazorRuntimeCompilation();
builder.Services.AddControllers();