new-infofer-scraper/server/Models/Database/TrainListing.cs

21 lines
690 B
C#
Raw Normal View History

using System.Collections.Generic;
2022-11-09 05:17:39 +01:00
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
2022-11-09 05:17:39 +01:00
) {
public TrainListing() : this(null, "", "", "", null) { }
public TrainListing(string rank, string number, string company) : this(null, rank, number, company, null) { }
2022-11-09 05:17:39 +01:00
}