Rework
This commit is contained in:
38
SQLiteEF/Player.cs
Normal file
38
SQLiteEF/Player.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SQLiteEF;
|
||||
|
||||
[PrimaryKey("SteamId")]
|
||||
public class Player : IUpdateable
|
||||
{
|
||||
public ulong SteamId { get; init; }
|
||||
public string Name { get; set; }
|
||||
public string ProfileUrl { get; set; }
|
||||
public string AvatarUrl { get; set; }
|
||||
|
||||
public ICollection<Game> Games { get; init; } = null!;
|
||||
public ICollection<TrackedTime> TrackedTimes { get; init; } = null!;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.Now;
|
||||
|
||||
public Player(ulong steamid, string name, string profileUrl, string avatarUrl)
|
||||
{
|
||||
this.SteamId = steamid;
|
||||
this.Name = name;
|
||||
this.ProfileUrl = profileUrl;
|
||||
this.AvatarUrl = avatarUrl;
|
||||
this.Games = [];
|
||||
this.TrackedTimes = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// EF CORE
|
||||
/// </summary>
|
||||
internal Player(ulong steamid, string name, string profileUrl, string avatarUrl, DateTime updatedAt)
|
||||
{
|
||||
this.SteamId = steamid;
|
||||
this.Name = name;
|
||||
this.ProfileUrl = profileUrl;
|
||||
this.AvatarUrl = avatarUrl;
|
||||
this.UpdatedAt = updatedAt;
|
||||
}
|
||||
}
|
14
SQLiteEF/SQLiteEF.csproj
Normal file
14
SQLiteEF/SQLiteEF.csproj
Normal file
@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Reference in New Issue
Block a user