aboutsummaryrefslogtreecommitdiff
path: root/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStop.cs
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-12-12 08:56:32 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-12-12 10:24:53 +0100
commitd65ce8288bbda3cb6e0b37613c29d7bf52703ba7 (patch)
treef6aaf58bbebeaa9b147e895ff8a5388881fa51d8 /src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStop.cs
parent661cccc2da9a6c32b7b56c60313787282a9084ea (diff)
Some rework on the ServiceViewer (which will be repurposed for live multi-GTFS serving)
Diffstat (limited to 'src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStop.cs')
-rw-r--r--src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStop.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStop.cs b/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStop.cs
index 20900d7..f604c5f 100644
--- a/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStop.cs
+++ b/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStop.cs
@@ -1,17 +1,22 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Costasdev.ServiceViewer.Data.Gtfs.Enums;
+using Microsoft.EntityFrameworkCore;
+using NetTopologySuite.Geometries;
namespace Costasdev.ServiceViewer.Data.Gtfs;
-[Table("stops")]
+[Table("gtfs_stops")]
+[PrimaryKey(nameof(Id), nameof(FeedId))]
public class GtfsStop
{
- [Key]
[Column("stop_id")]
[MaxLength(32)]
public required string Id { get; set; }
+ [Column("feed_id")]public int FeedId { get; set; }
+ [ForeignKey(nameof(FeedId))] public required Feed Feed { get; set; }
+
[Column("stop_code")]
[MaxLength(32)]
public string Code { get; set; } = string.Empty;
@@ -24,11 +29,8 @@ public class GtfsStop
[MaxLength(255)]
public string? Description { get; set; }
- [Column("stop_lat")]
- public double Latitude { get; set; }
-
- [Column("stop_lon")]
- public double Longitude { get; set; }
+ [Column("stop_pos")]
+ public Point? Position { get; set; }
[Column("stop_url")]
[MaxLength(255)]