This repository was archived by the owner on Feb 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Source/LinqToDB.EntityFrameworkCore
Tests/LinqToDB.EntityFrameworkCore.BaseTests Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -141,10 +141,14 @@ static IEnumerable<InheritanceMappingAttribute> GetMappingAttributesRecursive(IE
141141
142142 List < InheritanceMappingAttribute > ProcessEntityType ( IEntityType et )
143143 {
144- mappings . Add ( new ( )
144+ if ( ! et . ClrType . IsAbstract )
145145 {
146- Type = et . ClrType , Code = entityType . GetDiscriminatorValue ( )
147- } ) ;
146+ mappings . Add ( new ( )
147+ {
148+ Type = et . ClrType ,
149+ Code = entityType . GetDiscriminatorValue ( )
150+ } ) ;
151+ }
148152
149153 if ( et . BaseType == null )
150154 return mappings ;
Original file line number Diff line number Diff line change @@ -168,13 +168,14 @@ public virtual async Task TestInheritance()
168168 using var context = CreateContext ( ) ;
169169 using var connection = context . CreateLinqToDBConnection ( ) ;
170170
171+ context . WithInheritance . AddRange ( new List < WithInheritanceA > ( ) { new ( ) { } } ) ;
171172 context . WithInheritance . AddRange ( new List < WithInheritanceA1 > ( ) { new ( ) { } , new ( ) { } } ) ;
172173 context . WithInheritance . AddRange ( new List < WithInheritanceA2 > ( ) { new ( ) { } , new ( ) { } } ) ;
173174 await context . SaveChangesAsync ( ) ;
174175
175176 var result = context . GetTable < WithInheritanceA > ( ) . ToList ( ) ;
176177
177- result . OfType < WithInheritance > ( ) . Should ( ) . HaveCount ( 4 ) ;
178+ result . OfType < WithInheritance > ( ) . Should ( ) . HaveCount ( 5 ) ;
178179 result . OfType < WithInheritanceA1 > ( ) . Should ( ) . HaveCount ( 2 ) ;
179180 result . OfType < WithInheritanceA2 > ( ) . Should ( ) . HaveCount ( 2 ) ;
180181 }
You can’t perform that action at this time.
0 commit comments