File tree Expand file tree Collapse file tree 3 files changed +4
-1
lines changed
DataLayer/SpecialisedEntities Expand file tree Collapse file tree 3 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ public class UserConfig : IEntityTypeConfiguration<User>
1111 public void Configure
1212 ( EntityTypeBuilder < User > entity )
1313 {
14+ entity . HasAlternateKey ( p => p . Email ) ;
15+
1416 entity
1517 . OwnsOne ( e => e . HomeAddress )
1618 . ToTable ( "Addresses" ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ public class User
99
1010 public string Name { get ; set ; }
1111
12+ public string Email { get ; set ; }
13+
1214 public Address HomeAddress { get ; set ; }
1315 }
1416}
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ See [Run SQL Script](https://github.com/JonPSmith/EfCore.TestSupport/wiki/7.-Run
3939See [ Capture EF Core logging] ( https://github.com/JonPSmith/EfCore.TestSupport/wiki/8.-Capture-EF-Core-logging ) .
40409 . Tool to compare EF Core's view of the database with an actual database.
4141See [ EfSchemaCompare] ( https://github.com/JonPSmith/EfCore.TestSupport/wiki/9.-EfSchemaCompare ) .
42- * NOTE: This is on beta release - it works, but I haven't tested all the possible EF Core mappings.*
4342
4443
4544
You can’t perform that action at this time.
0 commit comments