Skip to content

Commit 626baf3

Browse files
authored
Add Components property to ISubclassInspectorBase to match the capabilities of IClassInspector (#466)
Modified SubclassInspector and JoinedSubclassInspector to implement the extended interface. Co-authored-by: Akkerman <[email protected]> +semver:breaking
1 parent 7de2ddb commit 626baf3

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

src/FluentNHibernate/Conventions/Inspections/ISubclassInspectorBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public interface ISubclassInspectorBase : IInspector
99
bool Abstract { get; }
1010
IEnumerable<IAnyInspector> Anys { get; }
1111
IEnumerable<ICollectionInspector> Collections { get; }
12+
IEnumerable<IComponentBaseInspector> Components { get; }
1213
IEnumerable<IJoinInspector> Joins { get; }
1314
IEnumerable<IOneToOneInspector> OneToOnes { get; }
1415
IEnumerable<IPropertyInspector> Properties { get; }

src/FluentNHibernate/Conventions/Inspections/JoinedSubclassInspector.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ public IEnumerable<ICollectionInspector> Collections
7474
}
7575
}
7676

77+
public IEnumerable<IComponentBaseInspector> Components
78+
{
79+
get
80+
{
81+
return mapping.Components
82+
.Select(x =>
83+
{
84+
if (x.ComponentType == ComponentType.Component)
85+
return (IComponentBaseInspector)new ComponentInspector(x);
86+
87+
return (IComponentBaseInspector)new DynamicComponentInspector(x);
88+
});
89+
}
90+
}
91+
7792
public bool DynamicInsert
7893
{
7994
get { return mapping.DynamicInsert; }

src/FluentNHibernate/Conventions/Inspections/SubclassInspector.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ public IEnumerable<ICollectionInspector> Collections
5858
}
5959
}
6060

61+
public IEnumerable<IComponentBaseInspector> Components
62+
{
63+
get
64+
{
65+
return mapping.Components
66+
.Select(x =>
67+
{
68+
if (x.ComponentType == ComponentType.Component)
69+
return (IComponentBaseInspector)new ComponentInspector(x);
70+
71+
return (IComponentBaseInspector)new DynamicComponentInspector(x);
72+
});
73+
}
74+
}
75+
6176
public object DiscriminatorValue
6277
{
6378
get { return mapping.DiscriminatorValue; }

0 commit comments

Comments
 (0)