Cleanup inside models

This commit is contained in:
Benjamin
2024-12-29 22:01:47 +01:00
parent 7f123df4d0
commit 9368810703
6 changed files with 14 additions and 14 deletions

View File

@@ -80,7 +80,7 @@ namespace pointMaster.Controllers
vm.Add(new StatModel vm.Add(new StatModel
{ {
Title = "Points givet", Title = "Points givet ialt",
Value = pointData.Sum(x => x.Points + x.Turnout).ToString() Value = pointData.Sum(x => x.Points + x.Turnout).ToString()
}); });

View File

@@ -3,18 +3,18 @@
public class Patrulje public class Patrulje
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } = null!; public string Name { get; set; }
public List<PatruljeMedlem> PatruljeMedlems { get; set; } = null!; public List<PatruljeMedlem> PatruljeMedlems { get; set; }
public List<Point> Points { get; set; } = null!; public List<Point> Points { get; set; }
public DateTime? DateCreated { get; set; } public DateTime? DateCreated { get; set; }
} }
public class PatruljeMedlem public class PatruljeMedlem
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } = null!; public string Name { get; set; }
public int Age { get; set; } public int Age { get; set; }
public Patrulje Patrulje { get; set; } = null!; public Patrulje Patrulje { get; set; }
public DateTime? DateCreated { get; set; } public DateTime? DateCreated { get; set; }
} }
} }

View File

@@ -5,8 +5,8 @@
public int Id { get; set; } public int Id { get; set; }
public int Points { get; set; } public int Points { get; set; }
public int Turnout { get; set; } public int Turnout { get; set; }
public Patrulje Patrulje { get; set; } = null!; public Patrulje Patrulje { get; set; }
public Post Poster { get; set; } = null!; public Post Poster { get; set; }
public DateTime? DateCreated { get; set; } public DateTime? DateCreated { get; set; }
} }
} }

View File

@@ -3,9 +3,9 @@
public class Post public class Post
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } = null!; public string Name { get; set; }
public string Location { get; set; } = null!; public string Location { get; set; }
public string Description { get; set; } = null!; public string Description { get; set; }
public DateTime? DateCreated { get; set; } public DateTime? DateCreated { get; set; }
} }
} }

View File

@@ -3,7 +3,7 @@
ViewData["Title"] = "Opret patrulje"; ViewData["Title"] = "Opret patrulje";
} }
<h1>Create Patrulje</h1> <h1>Opret Patrulje</h1>
<div> <div>
<form asp-action="Create"> <form asp-action="Create">
@@ -13,6 +13,6 @@
<input asp-for="Name" class="form-control" autocomplete="off"/> <input asp-for="Name" class="form-control" autocomplete="off"/>
<span asp-validation-for="Name" class="text-danger"></span> <span asp-validation-for="Name" class="text-danger"></span>
</div> </div>
<input type="submit" class="btn btn-primary" /> <input type="submit" class="btn btn-primary" value="Opret"/>
</form> </form>
</div> </div>

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>f4aae456-b78c-4976-9472-dd315dc4a61f</UserSecretsId> <UserSecretsId>f4aae456-b78c-4976-9472-dd315dc4a61f</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>