Start of the Structure of event not tied to Challonge or smash.

Lads und Canzer \o>
This commit is contained in:
2022-03-20 02:59:48 +01:00
parent ab02d292da
commit 87c9883245
22 changed files with 709 additions and 445 deletions

View File

@@ -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>()

View File

@@ -15,6 +15,8 @@ namespace LaDOSE.Entity
public int? SmashId { get; set; }
public List<Tournament> Tournaments { get; set; }
}
}

View File

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

View File

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

View File

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