File tree Expand file tree Collapse file tree 3 files changed +5
-49
lines changed
FluentNHibernate.Testing/DomainModel/Mapping
FluentNHibernate/MappingModel Expand file tree Collapse file tree 3 files changed +5
-49
lines changed Original file line number Diff line number Diff line change @@ -159,26 +159,6 @@ public void MixedKeyPropertyAndManyToOneOrdering()
159
159
. RootElement . Element ( "class/composite-id/*[2]" )
160
160
. HasName ( "key-property" ) ;
161
161
}
162
-
163
- [ Test ]
164
- public void CompositeIdWithSubclass ( )
165
- {
166
- new MappingTester < CompIdTarget > ( )
167
- . SubClassMapping < ComIdSubclass > ( s =>
168
- {
169
- s . Table ( "subclasstable" ) ;
170
- s . KeyColumn ( "subclass_longId" ) ;
171
- s . KeyColumn ( "subclass_nullablelongId" ) ;
172
- } )
173
- . ForMapping ( c => c . CompositeId ( )
174
- . KeyProperty ( x => x . LongId )
175
- . KeyProperty ( x => x . NullableLongId ) )
176
- . Element ( "class/joined-subclass/key/*[1]" )
177
- . Exists ( ) . HasName ( "column" ) . HasAttribute ( "name" , "subclass_longId" )
178
- . RootElement . Element ( "class/joined-subclass/key/*[2]" )
179
- . Exists ( ) . HasName ( "column" ) . HasAttribute ( "name" , "subclass_nullablelongId" )
180
- ;
181
- }
182
162
183
163
public class CompIdTarget
184
164
{
@@ -203,10 +183,5 @@ public class ComponentKey
203
183
public virtual int KeyCol1 { get ; set ; }
204
184
public virtual int KeyCol2 { get ; set ; }
205
185
}
206
-
207
- public class ComIdSubclass : CompIdTarget
208
- {
209
-
210
- }
211
186
}
212
187
}
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
- using System . Runtime . Serialization ;
5
4
6
5
namespace FluentNHibernate . MappingModel . Collections
7
6
{
8
7
[ Serializable ]
9
- public class AttributeLayeredValues : ISerializable
8
+ public class AttributeLayeredValues
10
9
{
11
- readonly Dictionary < string , LayeredValues > inner ;
10
+ readonly Dictionary < string , LayeredValues > inner = new Dictionary < string , LayeredValues > ( ) ;
12
11
13
- public AttributeLayeredValues ( )
14
- {
15
- inner = new Dictionary < string , LayeredValues > ( ) ;
16
- }
17
-
18
- public AttributeLayeredValues ( SerializationInfo info , StreamingContext context )
19
- {
20
- inner = ( Dictionary < string , LayeredValues > ) info
21
- . GetValue ( "inner" , typeof ( Dictionary < string , LayeredValues > ) ) ;
22
- inner . OnDeserialization ( this ) ;
23
- }
24
-
25
12
public LayeredValues this [ string attribute ]
26
13
{
27
14
get
@@ -103,10 +90,5 @@ public override int GetHashCode()
103
90
104
91
return hashCode ;
105
92
}
106
-
107
- public void GetObjectData ( SerializationInfo info , StreamingContext context )
108
- {
109
- info . AddValue ( "inner" , inner ) ;
110
- }
111
93
}
112
94
}
Original file line number Diff line number Diff line change @@ -94,14 +94,13 @@ public ColumnMapping Clone()
94
94
95
95
public bool Equals ( ColumnMapping other )
96
96
{
97
- return ( other != null ) &&
98
- Equals ( other . attributes , attributes ) &&
99
- Equals ( other . Member , Member ) ;
97
+ return Equals ( other . attributes , attributes ) && Equals ( other . Member , Member ) ;
100
98
}
101
99
102
100
public override bool Equals ( object obj )
103
101
{
104
- return Equals ( obj as ColumnMapping ) ;
102
+ if ( obj . GetType ( ) != typeof ( ColumnMapping ) ) return false ;
103
+ return Equals ( ( ColumnMapping ) obj ) ;
105
104
}
106
105
107
106
public override int GetHashCode ( )
You can’t perform that action at this time.
0 commit comments