File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ using System . Collections . ObjectModel ;
2+ using System . ComponentModel . DataAnnotations ;
3+
4+ namespace SQLite . CodeFirst . Console . Entity
5+ {
6+ /// <summary>
7+ /// I agree, that this makes no sense.
8+ /// Its just to test the IsSelfReferencing method for table names which are shorter than 4 chars.
9+ /// See #66.
10+ /// </summary>
11+ public class Set
12+ {
13+ [ Key ]
14+ public string Title { get ; set ; }
15+
16+ public virtual Player Player { get ; set ; }
17+ }
18+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
1818 ConfigureStadionEntity ( modelBuilder ) ;
1919 ConfigureCoachEntity ( modelBuilder ) ;
2020 ConfigurePlayerEntity ( modelBuilder ) ;
21+ ConfigureSetEntity ( modelBuilder ) ;
2122
2223 var initializer = new FootballDbInitializer ( modelBuilder ) ;
2324 Database . SetInitializer ( initializer ) ;
@@ -56,5 +57,11 @@ private static void ConfigurePlayerEntity(DbModelBuilder modelBuilder)
5657 . WithMany ( team => team . Players )
5758 . WillCascadeOnDelete ( true ) ;
5859 }
60+
61+ private static void ConfigureSetEntity ( DbModelBuilder modelBuilder )
62+ {
63+ modelBuilder . Entity < Set > ( )
64+ . HasRequired ( s => s . Player ) ;
65+ }
5966 }
6067}
Original file line number Diff line number Diff line change 8080 <Compile Include =" Entity\IEntity.cs" />
8181 <Compile Include =" Entity\Person.cs" />
8282 <Compile Include =" Entity\Player.cs" />
83+ <Compile Include =" Entity\Set.cs" />
8384 <Compile Include =" Entity\Stadion.cs" />
8485 <Compile Include =" Entity\Team.cs" />
8586 <Compile Include =" FootballDbContext.cs" />
You can’t perform that action at this time.
0 commit comments