diff --git a/nrdkwebsite/Pages/index.cshtml b/nrdkwebsite/Pages/index.cshtml index e4de078..0f7b1f1 100644 --- a/nrdkwebsite/Pages/index.cshtml +++ b/nrdkwebsite/Pages/index.cshtml @@ -1,10 +1,9 @@ @page @model IndexModel @{ - ViewData["Title"] = "Home page"; + ViewData["Title"] = "home page"; } -

Привет, это сайт neroduckale

Мой никнейм читается по разному - неродакля, неродукель, неродакале, но одно в нем остается неизменным - неро.

спасибо мактайлорс за помощь с созданием сайта. version: 0.3 diff --git a/nrdkwebsite/Pages/layout.cshtml b/nrdkwebsite/Pages/layout.cshtml index 4050af7..9a8829f 100644 --- a/nrdkwebsite/Pages/layout.cshtml +++ b/nrdkwebsite/Pages/layout.cshtml @@ -9,21 +9,24 @@ - @* *@ + - + @* *@ +
- +
diff --git a/nrdkwebsite/Pages/users.cshtml b/nrdkwebsite/Pages/users.cshtml index 3ddda27..5c27c68 100644 --- a/nrdkwebsite/Pages/users.cshtml +++ b/nrdkwebsite/Pages/users.cshtml @@ -1,16 +1,23 @@ @page -@using System.Collections @model Users - - - - -
текст заголовкатекст заголовка
данныеданные
+Всего в таблице записей: +
+ + + +
АйдиНикнеймМасть
Loading...Loading...Loading...
+
\ No newline at end of file diff --git a/nrdkwebsite/Program.cs b/nrdkwebsite/Program.cs index 214ab99..860cee6 100644 --- a/nrdkwebsite/Program.cs +++ b/nrdkwebsite/Program.cs @@ -45,9 +45,8 @@ app.MapDelete("/api/users/{id:int}", async (int id, DatabaseHandler db) => { await db.SaveChangesAsync(); return Results.Json(user); }); //WORKS -app.MapPost("/api/users", async (User user, DatabaseHandler db)=> -{ - user.id = db.users.Count() + 1; +app.MapPost("/api/users", async (NewUser newuser, DatabaseHandler db) => { + User user = new User(newuser.nickname, db.users.Count() + 1, newuser.mast); await db.users.AddAsync(user); await db.SaveChangesAsync(); return user; diff --git a/nrdkwebsite/User.cs b/nrdkwebsite/User.cs index 7354bb5..5c22109 100644 --- a/nrdkwebsite/User.cs +++ b/nrdkwebsite/User.cs @@ -12,4 +12,15 @@ public class User this.id = id; this.mast = mast; } +} +public class NewUser +{ + public string nickname { get; set; } + public string mast { get; set; } + + public NewUser(string nickname, string mast) + { + this.nickname = nickname; + this.mast = mast; + } } \ No newline at end of file diff --git a/nrdkwebsite/wwwroot/css/style.css b/nrdkwebsite/wwwroot/css/style.css index 03cd81f..fc07fc8 100644 --- a/nrdkwebsite/wwwroot/css/style.css +++ b/nrdkwebsite/wwwroot/css/style.css @@ -15,10 +15,13 @@ a { .header-links { /*