aboutsummaryrefslogtreecommitdiff
path: root/VNLib.Plugins.Essentials.Content.Routing/Model/Route.cs
diff options
context:
space:
mode:
Diffstat (limited to 'VNLib.Plugins.Essentials.Content.Routing/Model/Route.cs')
-rw-r--r--VNLib.Plugins.Essentials.Content.Routing/Model/Route.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/VNLib.Plugins.Essentials.Content.Routing/Model/Route.cs b/VNLib.Plugins.Essentials.Content.Routing/Model/Route.cs
new file mode 100644
index 0000000..9af42f1
--- /dev/null
+++ b/VNLib.Plugins.Essentials.Content.Routing/Model/Route.cs
@@ -0,0 +1,47 @@
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+
+using Microsoft.EntityFrameworkCore;
+
+using VNLib.Plugins.Extensions.Data;
+
+namespace VNLib.Plugins.Essentials.Content.Routing.Model
+{
+ [Index(nameof(Id), IsUnique = true)]
+ internal class Route : DbModelBase
+ {
+ public override string Id { get; set; }
+ public override DateTime Created { get; set; }
+ public override DateTime LastModified { get; set; }
+
+ public string Hostname { get; set; }
+ public string MatchPath { get; set; }
+ [Column("Privilage")]
+ public long _privilage
+ {
+ get => (long)Privilage;
+ set => Privilage = (ulong)value;
+ }
+ [NotMapped]
+ public ulong Privilage { get; set; }
+
+ public string Alternate { get; set; }
+ public FpRoutine Routine { get; set; }
+
+ /// <summary>
+ /// The processing arguments that match the route
+ /// </summary>
+ [NotMapped]
+ public FileProcessArgs MatchArgs
+ {
+ get
+ {
+ return new FileProcessArgs()
+ {
+ Alternate = this.Alternate,
+ Routine = (FpRoutine) Routine
+ };
+ }
+ }
+ }
+}