Challonge Provider can create tournament

This commit is contained in:
2018-10-07 15:15:11 +02:00
parent 9a9d4c7053
commit 681deda3d2
17 changed files with 245 additions and 18 deletions

View File

@@ -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);
}
}

View File

@@ -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; }
}
}

View 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; }
}
}

View File

@@ -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; }
}
}