using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; namespace SQLiteEF; [PrimaryKey("TimeStamp")] public class TrackedTime { [JsonIgnore] public Game Game { get; init; } [JsonIgnore] public Player Player { get; init; } public DateTime TimeStamp { get; init; } public ulong TimePlayed { get; init; } public TrackedTime(Game game, Player player, ulong timePlayed, DateTime? timeStamp = null) { this.Game = game; this.Player = player; this.TimeStamp = timeStamp??DateTime.UtcNow; this.TimePlayed = timePlayed; } /// /// EF CORE /// internal TrackedTime(ulong timePlayed, DateTime timeStamp) { this.TimePlayed = timePlayed; this.TimeStamp = timeStamp; } }