aboutsummaryrefslogtreecommitdiffstats
path: root/src/Pages/Leverandorar.cshtml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Pages/Leverandorar.cshtml.cs')
-rw-r--r--src/Pages/Leverandorar.cshtml.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Pages/Leverandorar.cshtml.cs b/src/Pages/Leverandorar.cshtml.cs
new file mode 100644
index 0000000..e8f467b
--- /dev/null
+++ b/src/Pages/Leverandorar.cshtml.cs
@@ -0,0 +1,23 @@
+using System.Linq;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using Microsoft.EntityFrameworkCore;
+using VSH.Data;
+using VSH.Data.Enums;
+
+namespace VSH.Pages;
+
+public class Leverandorar : PageModel
+{
+ private readonly MainDbContext _context;
+
+ public Leverandorar(MainDbContext context) {
+ context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
+ _context = context;
+ }
+
+ public string DealersPageHtml { get; set; }
+
+ public void OnGet() {
+ DealersPageHtml = _context.Documents.FirstOrDefault(c => c.Type == DocumentType.DEALERS_PAGE)?.Content;
+ }
+} \ No newline at end of file