Rework
This commit is contained in:
29
SQLiteEF/TrackedTime.cs
Normal file
29
SQLiteEF/TrackedTime.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SQLiteEF;
|
||||
|
||||
[PrimaryKey("TimeStamp")]
|
||||
public class TrackedTime
|
||||
{
|
||||
public Game Game { get; init; }
|
||||
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.Now;
|
||||
this.TimePlayed = timePlayed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// EF CORE
|
||||
/// </summary>
|
||||
internal TrackedTime(ulong timePlayed, DateTime timeStamp)
|
||||
{
|
||||
this.TimePlayed = timePlayed;
|
||||
this.TimeStamp = timeStamp;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user