8
8
9
9
namespace ServiceStack . OrmLite . Tests . Expression
10
10
{
11
- public class Bar : IHasGuidId
11
+ public class BarJoin : IHasGuidId
12
12
{
13
13
[ PrimaryKey ]
14
14
public Guid Id { get ; set ; }
@@ -26,7 +26,7 @@ public class FooBar : IHasIntId
26
26
// And a foreign key to the foo table as well, but that is not necessary to show the problem.
27
27
28
28
[ Alias ( "fkBarId" ) ]
29
- [ ForeignKey ( typeof ( Bar ) , ForeignKeyName = "fk_FooBar_Bar" ) ]
29
+ [ ForeignKey ( typeof ( BarJoin ) , ForeignKeyName = "fk_FooBar_Bar" ) ]
30
30
public Guid BarId { get ; set ; }
31
31
}
32
32
@@ -69,10 +69,10 @@ internal class JoinResult
69
69
[ BelongTo ( typeof ( FooBarBaz ) ) ]
70
70
public decimal Amount { get ; set ; }
71
71
72
- [ BelongTo ( typeof ( Bar ) ) ]
72
+ [ BelongTo ( typeof ( BarJoin ) ) ]
73
73
public Guid BarId { get ; set ; }
74
74
75
- [ BelongTo ( typeof ( Bar ) ) ]
75
+ [ BelongTo ( typeof ( BarJoin ) ) ]
76
76
public string BarName { get ; set ; }
77
77
78
78
[ BelongTo ( typeof ( Baz ) ) ]
@@ -132,19 +132,19 @@ private static void InitTables(IDbConnection db)
132
132
{
133
133
db . DropTable < FooBarBaz > ( ) ;
134
134
db . DropTable < FooBar > ( ) ;
135
- db . DropTable < Bar > ( ) ;
135
+ db . DropTable < BarJoin > ( ) ;
136
136
db . DropTable < Baz > ( ) ;
137
137
138
138
db . CreateTable < Baz > ( ) ;
139
- db . CreateTable < Bar > ( ) ;
139
+ db . CreateTable < BarJoin > ( ) ;
140
140
db . CreateTable < FooBar > ( ) ;
141
141
db . CreateTable < FooBarBaz > ( ) ;
142
142
143
143
var bar1Id = new Guid ( "5bd67b84-bfdb-4057-9799-5e7a72a6eaa9" ) ;
144
144
var bar2Id = new Guid ( "a8061d08-6816-4e1e-b3d7-1178abcefa0d" ) ;
145
145
146
- db . Insert ( new Bar { Id = bar1Id , Name = "Banana" , } ) ;
147
- db . Insert ( new Bar { Id = bar2Id , Name = "Orange" , } ) ;
146
+ db . Insert ( new BarJoin { Id = bar1Id , Name = "Banana" , } ) ;
147
+ db . Insert ( new BarJoin { Id = bar2Id , Name = "Orange" , } ) ;
148
148
149
149
db . Insert ( new Baz { Id = 1 , Name = "Large" } ) ;
150
150
db . Insert ( new Baz { Id = 2 , Name = "Huge" } ) ;
@@ -166,7 +166,7 @@ public void ComplexJoin_with_JoinSqlBuilder()
166
166
167
167
/* This gives the expected values for BazId */
168
168
var jn = new JoinSqlBuilder < JoinResult , FooBar > ( )
169
- . Join < FooBar , Bar > (
169
+ . Join < FooBar , BarJoin > (
170
170
sourceColumn : dp => dp . BarId ,
171
171
destinationColumn : p => p . Id ,
172
172
destinationTableColumnSelection : p => new { BarName = p . Name , BarId = p . Id } )
@@ -202,7 +202,7 @@ public void ComplexJoin_with_SqlExpression()
202
202
InitTables ( db ) ;
203
203
204
204
var q = db . From < FooBar > ( )
205
- . Join < Bar > ( ( dp , p ) => dp . BarId == p . Id )
205
+ . Join < BarJoin > ( ( dp , p ) => dp . BarId == p . Id )
206
206
. Join < FooBarBaz > ( ( dp , dpss ) => dp . Id == dpss . FooBarId )
207
207
. Join < FooBarBaz , Baz > ( ( dpss , ss ) => dpss . BazId == ss . Id ) ;
208
208
0 commit comments