new-infofer-scraper/server/Models/Database/TrainListing.cs
Dan Cojocaru de5d85cff4
Improve speed by caching and using ObjectIDs
Also: Switch to C# 11, .NET 7
Also: Added /rapidoc
2022-11-15 20:01:19 +01:00

21 lines
No EOL
690 B
C#

using System.Collections.Generic;
using System.Text.Json.Serialization;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Server.Models.Database;
public record TrainListing(
[property: BsonId]
[property: BsonRepresentation(BsonType.ObjectId)]
[property: JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
string? Id,
string Rank,
string Number,
string Company,
[property: BsonRepresentation(BsonType.ObjectId)]
string? LatestDescription
) {
public TrainListing() : this(null, "", "", "", null) { }
public TrainListing(string rank, string number, string company) : this(null, rank, number, company, null) { }
}