-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Remove JSON data and move to plain old DB columns
First piece of implementation, migration is missing Refs #16
- Loading branch information
1 parent
69db90e
commit 3a1aab6
Showing
6 changed files
with
54 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,14 @@ | ||
using System.Collections.Generic; | ||
using KdyPojedeVlak.Web.Engine.DbStorage; | ||
using KdyPojedeVlak.Web.Engine.Djr; | ||
|
||
namespace KdyPojedeVlak.Web.Models; | ||
|
||
public class BasicTrainInfo | ||
public class BasicTrainInfo(int timetableYear, string number, string name, string firstPointName, string lastPointName, TrainCategory trainCategory, TrafficType trafficType) | ||
{ | ||
private readonly Dictionary<string, string> data; | ||
|
||
public BasicTrainInfo(int timetableYear, string number, string name, string dataJson, string firstPointName, string lastPointName) | ||
{ | ||
this.TimetableYear = timetableYear; | ||
this.Number = number; | ||
this.Name = name; | ||
this.FirstPointName = firstPointName; | ||
this.LastPointName = lastPointName; | ||
this.data = DbModelUtils.LoadDataJson(dataJson); | ||
} | ||
|
||
public TrainCategory TrainCategory => DbModelUtils.GetAttributeEnum(data, TrainTimetable.AttribTrainCategory, TrainCategory.Unknown); | ||
|
||
public TrafficType TrafficType => DbModelUtils.GetAttributeEnum(data, TrainTimetable.AttribTrafficType, TrafficType.Unknown); | ||
|
||
public int TimetableYear { get; init; } | ||
public string Number { get; init; } | ||
public string Name { get; init; } | ||
public string FirstPointName { get; init; } | ||
public string LastPointName { get; init; } | ||
public int TimetableYear { get; } = timetableYear; | ||
public string Number { get; } = number; | ||
public string Name { get; } = name; | ||
public string FirstPointName { get; } = firstPointName; | ||
public string LastPointName { get; } = lastPointName; | ||
public TrainCategory TrainCategory { get; } = trainCategory; | ||
public TrafficType TrafficType { get; } = trafficType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters