Cache the Challonge results

This commit is contained in:
2019-08-06 01:56:33 +02:00
parent b4f9a0a132
commit a9f3da1b8e
13 changed files with 334 additions and 90 deletions

View File

@@ -1,4 +1,5 @@
using LaDOSE.Entity.Wordpress;
using LaDOSE.Entity.Challonge;
using LaDOSE.Entity.Wordpress;
using Microsoft.EntityFrameworkCore;
namespace LaDOSE.Entity.Context
@@ -20,6 +21,8 @@ namespace LaDOSE.Entity.Context
#endregion
public DbSet<SeasonGame> SeasonGame { get; set; }
public DbSet<EventGame> EventGame { get; set; }
public DbSet<ChallongeParticipent> ChallongeParticipent { get; set; }
public DbSet<ChallongeTournament> ChallongeTournament { get; set; }
public LaDOSEDbContext(DbContextOptions options) : base(options)
{
@@ -87,6 +90,12 @@ namespace LaDOSE.Entity.Context
.HasForeignKey(pt => pt.WPUserId);
#endregion
#region Challonge
modelBuilder.Entity<ChallongeParticipent>()
.HasOne(pt => pt.ChallongeTournament)
.WithMany(p => p.Participents)
.HasForeignKey(pt => pt.ChallongeTournamentId);
#endregion
}
}