new-infofer-scraper/server/Models/Database/TrainListing.cs
Dan Cojocaru 9e680e3bb2
Use Newtonsoft.Json instead of System.Text.Json
Fixed bug related to serializing properties inherited from interface
2023-09-03 04:31:41 +03:00

20 lines
No EOL
640 B
C#

using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using Newtonsoft.Json;
namespace Server.Models.Database;
public record TrainListing(
[property: BsonId]
[property: BsonRepresentation(BsonType.ObjectId)]
[property: JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
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) { }
}