reworked Model
This commit is contained in:
parent
15608f0e31
commit
04049f31f6
12 changed files with 34 additions and 48 deletions
|
@ -1,11 +1,8 @@
|
|||
#nullable disable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Lieb.Models;
|
||||
using Lieb.Models.Raid;
|
||||
using Lieb.Models.GuildWars2;
|
||||
using Lieb.Models.GuildWars2.Raid;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Lieb.Data
|
||||
{
|
||||
|
@ -19,28 +16,24 @@ namespace Lieb.Data
|
|||
public DbSet<LiebUser> Users { get; set; }
|
||||
public DbSet<GuildWars2Account> GuildWars2Account { get; set; }
|
||||
public DbSet<Equipped> Equipped { get; set; }
|
||||
public DbSet<RaidRole> RaidRoles { get; set; }
|
||||
public DbSet<PlannedRaid> PlannedRaids { get; set; }
|
||||
public DbSet<GuildWars2Build> RaidRoles { get; set; }
|
||||
public DbSet<PlannedRaidRole> PlannedRaidRoles { get; set; }
|
||||
public DbSet<Raid> Raids { get; set; }
|
||||
public DbSet<RaidReminder> RaidReminders { get; set; }
|
||||
public DbSet<RaidSignUp> RaidSignUps { get; set; }
|
||||
public DbSet<RandomRaid> RandomRaids { get; set; }
|
||||
public DbSet<SignUpHistory> SignUpHistories { get; set; }
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<LiebUser>().ToTable("User");
|
||||
modelBuilder.Entity<LiebUser>().ToTable("LiebUser");
|
||||
modelBuilder.Entity<GuildWars2Account>().ToTable("GuildWars2Account");
|
||||
modelBuilder.Entity<Equipped>().ToTable("Equipped");
|
||||
modelBuilder.Entity<RaidRole>().ToTable("RaidRole");
|
||||
modelBuilder.Entity<PlannedRaid>().ToTable("PlannedRaid");
|
||||
modelBuilder.Entity<GuildWars2Build>().ToTable("GuildWars2Build");
|
||||
modelBuilder.Entity<PlannedRaidRole>().ToTable("PlannedRaidRole");
|
||||
modelBuilder.Entity<Raid>().ToTable("Raid");
|
||||
modelBuilder.Entity<RaidReminder>().ToTable("RaidReminder");
|
||||
modelBuilder.Entity<RaidSignUp>().ToTable("RaidSignUp");
|
||||
modelBuilder.Entity<RandomRaid>().ToTable("RandomRaid");
|
||||
modelBuilder.Entity<SignUpHistory>().ToTable("SignUpHistory");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Lieb.Models
|
||||
namespace Lieb.Models.GuildWars2
|
||||
{
|
||||
public class Equipped
|
||||
{
|
||||
|
@ -9,6 +9,6 @@
|
|||
public int GuildWars2AccountId { get; set; }
|
||||
public int RaidRoleId { get; set; }
|
||||
public GuildWars2Account GuildWars2Account { get; set; } = new GuildWars2Account();
|
||||
public RaidRole RaidRole { get; set; } = new RaidRole();
|
||||
public GuildWars2Build RaidRole { get; set; } = new GuildWars2Build();
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
namespace Lieb.Models
|
||||
namespace Lieb.Models.GuildWars2
|
||||
{
|
||||
public class GuildWars2Account
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Lieb.Models
|
||||
namespace Lieb.Models.GuildWars2
|
||||
{
|
||||
public enum Role
|
||||
{
|
||||
|
@ -64,10 +64,10 @@
|
|||
Bladesworn = 36,
|
||||
}
|
||||
|
||||
public class RaidRole
|
||||
public class GuildWars2Build
|
||||
{
|
||||
public int RaidRoleId { get; set; }
|
||||
public string RoleName { get; set; } = String.Empty;
|
||||
public int GuildWars2BuildId { get; set; }
|
||||
public string BuildName { get; set; } = String.Empty;
|
||||
|
||||
public short Might { get; set; }
|
||||
public short Quickness { get; set; }
|
|
@ -1,4 +1,4 @@
|
|||
namespace Lieb.Models.Raid
|
||||
namespace Lieb.Models.GuildWars2.Raid
|
||||
{
|
||||
public class PlannedRaidRole
|
||||
{
|
|
@ -1,5 +1,13 @@
|
|||
namespace Lieb.Models.Raid
|
||||
namespace Lieb.Models.GuildWars2.Raid
|
||||
{
|
||||
public enum RaidType
|
||||
{
|
||||
Planned = 1,
|
||||
RandomWithBoons = 2,
|
||||
RandomClasses = 3,
|
||||
RandomEliteSpecialization = 4,
|
||||
}
|
||||
|
||||
public abstract class Raid
|
||||
{
|
||||
public int RaidId { get; private set; }
|
||||
|
@ -20,6 +28,11 @@
|
|||
|
||||
public int Frequency { get; set; }
|
||||
|
||||
public RaidType RaidType { get; set; }
|
||||
|
||||
//role name, number of spots
|
||||
public ICollection<PlannedRaidRole> Roles { get; set; } = new HashSet<PlannedRaidRole>();
|
||||
|
||||
public ICollection<RaidReminder> Reminders { get; set; } = new List<RaidReminder>();
|
||||
|
||||
public ICollection<RaidSignUp> SignUps { get; set; } = new HashSet<RaidSignUp>();
|
|
@ -1,4 +1,4 @@
|
|||
namespace Lieb.Models.Raid
|
||||
namespace Lieb.Models.GuildWars2.Raid
|
||||
{
|
||||
public class RaidReminder
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Lieb.Models.Raid
|
||||
namespace Lieb.Models.GuildWars2.Raid
|
||||
{
|
||||
public enum SignUpType
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Lieb.Models.Raid
|
||||
namespace Lieb.Models.GuildWars2.Raid
|
||||
{
|
||||
public class SignUpHistory
|
||||
{
|
|
@ -1,4 +1,6 @@
|
|||
namespace Lieb.Models
|
||||
using Lieb.Models.GuildWars2;
|
||||
|
||||
namespace Lieb.Models
|
||||
{
|
||||
public class LiebUser
|
||||
{
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
namespace Lieb.Models.Raid
|
||||
{
|
||||
public class PlannedRaid : Raid
|
||||
{
|
||||
//role name, number of spots
|
||||
public ICollection<PlannedRaidRole> Roles { get; set; } = new HashSet<PlannedRaidRole>();
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
namespace Lieb.Models.Raid
|
||||
{
|
||||
public class RandomRaid : Raid
|
||||
{
|
||||
public short Might { get; set; }
|
||||
public short Quickness { get; set; }
|
||||
public short Alacrity { get; set; }
|
||||
public short Heal { get; set; }
|
||||
public LiebUser Tank { get; set; } = new LiebUser();
|
||||
|
||||
public bool RandomClass { get; set; }
|
||||
public bool RandomEliteSpecialization { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue