Start of the Structure of event not tied to Challonge or smash.
Lads und Canzer \o>
This commit is contained in:
@@ -40,15 +40,23 @@ namespace LaDOSE.Entity.Context
|
||||
|
||||
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
|
||||
|
||||
//modelBuilder.Entity<Event>()
|
||||
// .HasOne(s => s.Season)
|
||||
// .WithMany(p => p.Event)
|
||||
// .HasForeignKey(fk => fk.SeasonId);
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<Event>()
|
||||
.HasMany(s => s.Tournaments);
|
||||
|
||||
|
||||
modelBuilder.Entity<Tournament>()
|
||||
.HasOne(e => e.Game)
|
||||
.WithMany(e=>e.Tournaments)
|
||||
.HasForeignKey(pt=>pt.GameId)
|
||||
;
|
||||
modelBuilder.Entity<Tournament>()
|
||||
.HasOne(e => e.Event)
|
||||
.WithMany(e => e.Tournaments)
|
||||
.HasForeignKey(pt => pt.EventId)
|
||||
;
|
||||
|
||||
//#region SeasonGame
|
||||
//modelBuilder.Entity<SeasonGame>()
|
||||
@@ -67,7 +75,7 @@ namespace LaDOSE.Entity.Context
|
||||
|
||||
//#region EventGame
|
||||
|
||||
//modelBuilder.Entity<EventGame>()
|
||||
//modelBuilder.Entity<T>()
|
||||
// .HasKey(t => new { t.EventId, t.GameId });
|
||||
|
||||
//modelBuilder.Entity<EventGame>()
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace LaDOSE.Entity
|
||||
public int? SmashId { get; set; }
|
||||
|
||||
|
||||
public List<Tournament> Tournaments { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace LaDOSE.Entity
|
||||
@@ -11,19 +12,13 @@ namespace LaDOSE.Entity
|
||||
{
|
||||
}
|
||||
|
||||
public Player(string name, int? challongeId, int? smashId)
|
||||
{
|
||||
this.Name = name;
|
||||
ChallongeId = challongeId;
|
||||
SmashId = smashId;
|
||||
}
|
||||
|
||||
|
||||
public String SmashName { get; set; }
|
||||
public String Gamertag { get; set; }
|
||||
public String Name { get; set; }
|
||||
public int? ChallongeId {get;set;}
|
||||
public int? SmashId {get;set;}
|
||||
|
||||
[NotMapped]
|
||||
public Boolean IsChallonge => ChallongeId.HasValue;
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
public int PlayerId { get; set; }
|
||||
public Player Player { get; set; }
|
||||
public int IdTournament { get; set; }
|
||||
public int TournamentId { get; set; }
|
||||
public Tournament Tournament{ get; set; }
|
||||
public int Point { get; set; }
|
||||
public int Rank { get; set; }
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace LaDOSE.Entity
|
||||
{
|
||||
@@ -15,11 +17,18 @@ namespace LaDOSE.Entity
|
||||
SmashId = smashId;
|
||||
}
|
||||
|
||||
public int EventId { get; set; }
|
||||
public Event Event { get; set; }
|
||||
public String Name { get; set; }
|
||||
public int ChallongeId {get;set;}
|
||||
public int SmashId {get;set;}
|
||||
public int? GameId {get;set;}
|
||||
public Game Game { get; set; }
|
||||
|
||||
|
||||
public List<Result> Results { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user