@@ -9,7 +9,6 @@ namespace FluentNHibernate.Mapping
9
9
public class ManyToManyPart < TChild > : ToManyBase < ManyToManyPart < TChild > , TChild , ManyToManyMapping >
10
10
{
11
11
private readonly IList < FilterPart > childFilters = new List < FilterPart > ( ) ;
12
- private readonly Type entity ;
13
12
private readonly FetchTypeExpression < ManyToManyPart < TChild > > fetch ;
14
13
private readonly NotFoundExpression < ManyToManyPart < TChild > > notFound ;
15
14
private IndexManyToManyPart manyToManyIndex ;
@@ -23,13 +22,11 @@ public class ManyToManyPart<TChild> : ToManyBase<ManyToManyPart<TChild>, TChild,
23
22
public ManyToManyPart ( Type entity , Member property )
24
23
: this ( entity , property , property . PropertyType )
25
24
{
26
- childType = property . PropertyType ;
27
25
}
28
26
29
27
protected ManyToManyPart ( Type entity , Member member , Type collectionType )
30
28
: base ( entity , member , collectionType )
31
29
{
32
- this . entity = entity ;
33
30
childType = collectionType ;
34
31
35
32
fetch = new FetchTypeExpression < ManyToManyPart < TChild > > ( this , value => collectionAttributes . Set ( x => x . Fetch , value ) ) ;
@@ -220,8 +217,7 @@ protected override ICollectionRelationshipMapping GetRelationship()
220
217
{
221
218
var mapping = new ManyToManyMapping ( relationshipAttributes . CloneInner ( ) )
222
219
{
223
- ContainingEntityType = entity ,
224
-
220
+ ContainingEntityType = EntityType ,
225
221
} ;
226
222
227
223
if ( isTernary && valueType != null )
@@ -336,7 +332,7 @@ protected override CollectionMapping GetCollectionMapping()
336
332
337
333
// key columns
338
334
if ( parentKeyColumns . Count == 0 )
339
- collection . Key . AddDefaultColumn ( new ColumnMapping { Name = entity . Name + "_id" } ) ;
335
+ collection . Key . AddDefaultColumn ( new ColumnMapping { Name = EntityType . Name + "_id" } ) ;
340
336
341
337
foreach ( var column in parentKeyColumns )
342
338
collection . Key . AddColumn ( column ) ;
0 commit comments