diff --git a/Moldinium/Baking/NullableContextAttribute.cs b/Moldinium/Baking/NullableContextAttribute.cs index b2c57be..b5a3335 100644 --- a/Moldinium/Baking/NullableContextAttribute.cs +++ b/Moldinium/Baking/NullableContextAttribute.cs @@ -98,7 +98,7 @@ public static void SetNullableAttributes(Action target, if (arg is IReadOnlyCollection moreArgs) { - arg = moreArgs.Select(a => (Byte)a.Value).ToArray(); + arg = moreArgs.Select(a => (Byte)a.Value!).ToArray(); } var builder = new CustomAttributeBuilder(attribute.Constructor, new Object[] { arg } ); diff --git a/SampleApp.AspNetMvc/Controllers/HomeController.cs b/SampleApp.AspNetMvc/Controllers/HomeController.cs index da22ac2..e68f520 100644 --- a/SampleApp.AspNetMvc/Controllers/HomeController.cs +++ b/SampleApp.AspNetMvc/Controllers/HomeController.cs @@ -13,6 +13,7 @@ public HomeController(JobList jobList) this.jobList = jobList; } + [Route("add-simple")] public IActionResult AddSimpleJob() { jobList.AddSimpleJobCommand.Execute(null); @@ -20,6 +21,7 @@ public IActionResult AddSimpleJob() return RedirectToAction(nameof(Index)); } + [Route("add-complex")] public IActionResult AddComplexJob() { jobList.AddComplexJobCommand.Execute(null); @@ -27,6 +29,7 @@ public IActionResult AddComplexJob() return RedirectToAction(nameof(Index)); } + [Route("add-cancel")] public IActionResult Cancel() { jobList.CancelCommand.Execute(null); diff --git a/SampleApp.AspNetMvc/GlobalUsings.cs b/SampleApp.AspNetMvc/GlobalUsings.cs deleted file mode 100644 index f60afb0..0000000 --- a/SampleApp.AspNetMvc/GlobalUsings.cs +++ /dev/null @@ -1 +0,0 @@ -global using SampleApp; \ No newline at end of file diff --git a/SampleApp.AspNetMvc/Program.cs b/SampleApp.AspNetMvc/Program.cs index 49dacb0..fae0dd1 100644 --- a/SampleApp.AspNetMvc/Program.cs +++ b/SampleApp.AspNetMvc/Program.cs @@ -1,13 +1,13 @@ using Moldinium; using Moldinium.Injection; +using SampleApp; using System.Diagnostics; var builder = WebApplication.CreateBuilder(args); var services = builder.Services; -// Add services to the container. -services.AddControllersWithViews(); +services.AddControllersWithViews().AddRazorRuntimeCompilation(); var configuration = new DefaultDependencyProviderConfiguration( Baking: DefaultDependencyProviderBakingMode.Basic, diff --git a/SampleApp.AspNetMvc/SampleApp.AspNetMvc.csproj b/SampleApp.AspNetMvc/SampleApp.AspNetMvc.csproj index 40e0e04..f121ed4 100644 --- a/SampleApp.AspNetMvc/SampleApp.AspNetMvc.csproj +++ b/SampleApp.AspNetMvc/SampleApp.AspNetMvc.csproj @@ -6,6 +6,10 @@ enable + + + + diff --git a/SampleApp.AspNetMvc/Views/Home/Index.cshtml b/SampleApp.AspNetMvc/Views/Home/Index.cshtml index 28e230a..cc97b52 100644 --- a/SampleApp.AspNetMvc/Views/Home/Index.cshtml +++ b/SampleApp.AspNetMvc/Views/Home/Index.cshtml @@ -1,18 +1,21 @@ -@model SampleApp.JobList +@using SampleApp +@model JobList @{ ViewData["Title"] = "ASP.NET MVC Job List Sample App"; }
-
- - +
+
-
+
@foreach (var job in Model.Items) { diff --git a/SampleApp.AspNetMvc/Views/Home/_ComplexJob.cshtml b/SampleApp.AspNetMvc/Views/Home/_ComplexJob.cshtml index f767031..3e05ba1 100644 --- a/SampleApp.AspNetMvc/Views/Home/_ComplexJob.cshtml +++ b/SampleApp.AspNetMvc/Views/Home/_ComplexJob.cshtml @@ -1,4 +1,5 @@ -@model SampleApp.ComplexJob +@using SampleApp +@model ComplexJob
@foreach (var subJob in Model.SubJobs) diff --git a/SampleApp.AspNetMvc/Views/Home/_Job.cshtml b/SampleApp.AspNetMvc/Views/Home/_Job.cshtml index 8b08832..871ef82 100644 --- a/SampleApp.AspNetMvc/Views/Home/_Job.cshtml +++ b/SampleApp.AspNetMvc/Views/Home/_Job.cshtml @@ -1,4 +1,5 @@ -@model SampleApp.Job +@using SampleApp +@model Job @{ var style = $"margin-left: {1 + (Model.NestingLevel?.Level ?? 0)}em"; diff --git a/SampleApp.AspNetMvc/Views/Home/_SimpleJob.cshtml b/SampleApp.AspNetMvc/Views/Home/_SimpleJob.cshtml index 946f97c..ee552c1 100644 --- a/SampleApp.AspNetMvc/Views/Home/_SimpleJob.cshtml +++ b/SampleApp.AspNetMvc/Views/Home/_SimpleJob.cshtml @@ -1,4 +1,5 @@ -@model SampleApp.SimpleJob +@using SampleApp +@model SimpleJob
diff --git a/SampleApp.AspNetMvc/Views/Shared/_Layout.cshtml b/SampleApp.AspNetMvc/Views/Shared/_Layout.cshtml index 1d96ca9..992db5b 100644 --- a/SampleApp.AspNetMvc/Views/Shared/_Layout.cshtml +++ b/SampleApp.AspNetMvc/Views/Shared/_Layout.cshtml @@ -9,41 +9,41 @@ -
- -
-
-
+ + +
@RenderBody()
-