Get the sets
This commit is contained in:
@@ -26,6 +26,7 @@ namespace LaDOSE.Entity.Context
|
||||
public DbSet<Event> Event { get; set; }
|
||||
public DbSet<Tournament> Tournament { get; set; }
|
||||
public DbSet<Result> Result { get; set; }
|
||||
public DbSet<Set> Set { get; set; }
|
||||
|
||||
#endregion
|
||||
public DbSet<ChallongeParticipent> ChallongeParticipent { get; set; }
|
||||
@@ -58,6 +59,23 @@ namespace LaDOSE.Entity.Context
|
||||
.HasForeignKey(pt => pt.EventId)
|
||||
;
|
||||
|
||||
modelBuilder.Entity<Set>()
|
||||
.HasOne(e => e.Tournament)
|
||||
.WithMany(e => e.Sets)
|
||||
.HasForeignKey(pt => pt.TournamentId)
|
||||
;
|
||||
|
||||
//modelBuilder.Entity<Set>()
|
||||
// .HasOne(e => e.Player1)
|
||||
// .WithMany(e => e.Sets)
|
||||
// .HasForeignKey(pt => pt.Player1Id)
|
||||
// ;
|
||||
|
||||
//modelBuilder.Entity<Set>()
|
||||
// .HasOne(e => e.Player2)
|
||||
// .WithMany(e => e.Sets)
|
||||
// .HasForeignKey(pt => pt.Player2Id)
|
||||
// ;
|
||||
//#region SeasonGame
|
||||
//modelBuilder.Entity<SeasonGame>()
|
||||
// .HasKey(t => new { t.SeasonId, t.GameId });
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace LaDOSE.Entity
|
||||
}
|
||||
|
||||
public String Name { get; set; }
|
||||
public String SmashSlug { get; set; }
|
||||
public int? SmashId { get; set; }
|
||||
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
@@ -21,6 +22,7 @@ namespace LaDOSE.Entity
|
||||
[NotMapped]
|
||||
public Boolean IsChallonge => ChallongeId.HasValue;
|
||||
|
||||
//public List<Set> Sets { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
24
LaDOSE.Src/LaDOSE.Entity/TournamentEntities/Set.cs
Normal file
24
LaDOSE.Src/LaDOSE.Entity/TournamentEntities/Set.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace LaDOSE.Entity
|
||||
{
|
||||
public class Set : Context.Entity
|
||||
{
|
||||
public int TournamentId { get; set; }
|
||||
public Tournament Tournament { get; set; }
|
||||
|
||||
|
||||
public int Player1Id { get; set; }
|
||||
//[ForeignKey("Player1Id")]
|
||||
//public Player Player1 { get; set; }
|
||||
|
||||
public int Player2Id { get; set; }
|
||||
//[ForeignKey("Player2Id")]
|
||||
//public Player Player2 { get; set; }
|
||||
|
||||
public int Player1Score { get; set; }
|
||||
public int Player2Score { get; set; }
|
||||
|
||||
public int Round { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,11 @@ namespace LaDOSE.Entity
|
||||
public int? GameId {get;set;}
|
||||
public Game Game { get; set; }
|
||||
|
||||
public bool Finish { get; set; }
|
||||
public List<Result> Results { get; set; }
|
||||
public List<Set> Sets { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user