Bot Event
This commit is contained in:
23
LaDOSE.Src/LaDOSE.Entity/BotEvent/BotEvent.cs
Normal file
23
LaDOSE.Src/LaDOSE.Entity/BotEvent/BotEvent.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace LaDOSE.Entity.BotEvent
|
||||
{
|
||||
public class BotEvent : Context.Entity
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public virtual ICollection<BotEventResult> Results { get; set; }
|
||||
|
||||
}
|
||||
public class BotEventResult : Context.Entity
|
||||
{
|
||||
public int BotEventId { get; set; }
|
||||
public BotEvent BotEvent { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public string DiscordId { get; set; }
|
||||
public bool Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using LaDOSE.Entity.Challonge;
|
||||
|
||||
using LaDOSE.Entity.Wordpress;
|
||||
using LaDOSE.Entity.BotEvent;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LaDOSE.Entity.Context
|
||||
@@ -32,6 +32,10 @@ namespace LaDOSE.Entity.Context
|
||||
public DbSet<ChallongeParticipent> ChallongeParticipent { get; set; }
|
||||
public DbSet<ChallongeTournament> ChallongeTournament { get; set; }
|
||||
|
||||
#region BotEvents
|
||||
public DbSet<BotEvent.BotEvent> BotEvent { get; set; }
|
||||
public DbSet<BotEventResult> BotEventResult { get; set; }
|
||||
#endregion
|
||||
public LaDOSEDbContext(DbContextOptions options) : base(options)
|
||||
{
|
||||
}
|
||||
@@ -69,7 +73,12 @@ namespace LaDOSE.Entity.Context
|
||||
.HasOne(e => e.Tournament)
|
||||
.WithMany(e => e.Results)
|
||||
.HasForeignKey(pt => pt.TournamentId);
|
||||
|
||||
|
||||
modelBuilder.Entity<BotEventResult>()
|
||||
.HasOne(e => e.BotEvent)
|
||||
.WithMany(e => e.Results)
|
||||
.HasForeignKey(pt => pt.BotEventId);
|
||||
|
||||
|
||||
|
||||
//modelBuilder.Entity<Set>()
|
||||
|
||||
Reference in New Issue
Block a user