new-infofer-scraper/server/Models/Database/StationListing.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

18 lines
565 B
C#

using System.Collections.Generic;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using Newtonsoft.Json;
namespace Server.Models.Database;
public record StationListing(
[property: BsonId]
[property: BsonRepresentation(BsonType.ObjectId)]
[property: JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
string? Id,
string Name,
List<string> StoppedAtBy
) {
public StationListing() : this(null, "", new()) { }
public StationListing(string name, List<string> stoppedAtBy) : this(null, name, stoppedAtBy) { }
}