diff --git a/Sources/EFLol/MyDbContext.cs b/Sources/EFLol/MyDbContext.cs index 7358097..a339870 100644 --- a/Sources/EFLol/MyDbContext.cs +++ b/Sources/EFLol/MyDbContext.cs @@ -10,9 +10,9 @@ namespace EFLol public class MyDbContext : DbContext { public DbSet Champions { get; set; } - public DbSet Skins { get; set; } - public DbSet Runes { get; set; } + public DbSet Skins { get; set; } public DbSet RunePages { get; set; } + public DbSet Runes { get; set; } public MyDbContext() { } @@ -36,7 +36,8 @@ namespace EFLol modelBuilder.Entity().Property(s => s.Id).ValueGeneratedOnAdd(); - modelBuilder.Entity().Property(s => s.Id).ValueGeneratedOnAdd(); + modelBuilder.Entity().Property(s => s.Id).ValueGeneratedOnAdd(); + modelBuilder.Entity().HasKey(sc => new { sc.StudentId, sc.CourseId }); modelBuilder.Entity().Property(s => s.Id).ValueGeneratedOnAdd(); } } diff --git a/Sources/EFLol/RuneEntity.cs b/Sources/EFLol/RuneEntity.cs index 1bd31e3..6b492fb 100644 --- a/Sources/EFLol/RuneEntity.cs +++ b/Sources/EFLol/RuneEntity.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -12,11 +13,7 @@ namespace EFLol public string Name { get; set; } public string Description { get; set; } public RuneFamilyEntity RuneFamily { get; set; } - - public static implicit operator Dictionary(RuneEntity v) - { - throw new NotImplementedException(); - } + public Collection ListRunePages { get; set; } } public enum RuneFamilyEntity diff --git a/Sources/EFLol/RunePageEntity.cs b/Sources/EFLol/RunePageEntity.cs index 144f7dd..4649f76 100644 --- a/Sources/EFLol/RunePageEntity.cs +++ b/Sources/EFLol/RunePageEntity.cs @@ -1,25 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EFLol -{ - public class RunePageEntity +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EFLol +{ + public class RunePageEntity { public int Id { get; set; } - public String Name { get; set; } - //public Dictionary Runes { get; set; } - } - - public enum Category - { - Major, - Minor1, - Minor2, - Minor3, - OtherMinor1, - OtherMinor2 - } -} + public String Name { get; set; } + //public Dictionary Runes { get; set; } + } + + public enum Category + { + Major, + Minor1, + Minor2, + Minor3, + OtherMinor1, + OtherMinor2 + } +}