Challonge Provider can create tournament
This commit is contained in:
@@ -21,12 +21,16 @@ namespace LaDOSE.Entity.Context
|
||||
base.OnModelCreating(modelBuilder);
|
||||
modelBuilder.Entity<SeasonGame>()
|
||||
.HasKey(t => new { t.SeasonId, t.GameId });
|
||||
modelBuilder.Entity<EventGame>()
|
||||
.HasKey(t => new { t.EventId, t.GameId });
|
||||
|
||||
modelBuilder.Entity<Event>()
|
||||
.HasOne(s => s.Season)
|
||||
.WithMany(p => p.Event)
|
||||
.HasForeignKey(fk => fk.SeasonId);
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<SeasonGame>()
|
||||
.HasOne(pt => pt.Season)
|
||||
.WithMany(p => p.Games)
|
||||
@@ -37,6 +41,17 @@ namespace LaDOSE.Entity.Context
|
||||
.WithMany(p => p.Seasons)
|
||||
.HasForeignKey(pt => pt.GameId);
|
||||
|
||||
|
||||
modelBuilder.Entity<EventGame>()
|
||||
.HasOne(pt => pt.Event)
|
||||
.WithMany(p => p.Games)
|
||||
.HasForeignKey(pt => pt.EventId);
|
||||
|
||||
modelBuilder.Entity<EventGame>()
|
||||
.HasOne(pt => pt.Game)
|
||||
.WithMany(p => p.Events)
|
||||
.HasForeignKey(pt => pt.GameId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LaDOSE.Entity
|
||||
@@ -13,5 +14,9 @@ namespace LaDOSE.Entity
|
||||
public Season Season { get; set; }
|
||||
public bool Ranking { get; set; }
|
||||
|
||||
|
||||
public virtual IEnumerable<EventGame> Games { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
12
LaDOSE.Src/LaDOSE.Entity/EventGame.cs
Normal file
12
LaDOSE.Src/LaDOSE.Entity/EventGame.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace LaDOSE.Entity
|
||||
{
|
||||
public class EventGame
|
||||
{
|
||||
|
||||
public int EventId { get; set; }
|
||||
public Event Event { get; set; }
|
||||
public int GameId { get; set; }
|
||||
public Game Game { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,7 @@ namespace LaDOSE.Entity
|
||||
public string ImgUrl { get; set; }
|
||||
|
||||
public virtual IEnumerable<SeasonGame> Seasons { get; set; }
|
||||
public virtual IEnumerable<EventGame> Events { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user