@@ -50,7 +50,7 @@ public enum LivingStatus
50
50
Dead
51
51
}
52
52
53
- public class Employee
53
+ public class DeptEmployee
54
54
{
55
55
[ PrimaryKey ]
56
56
public int Id { get ; set ; }
@@ -96,11 +96,11 @@ public class AutoQueryTests : OrmLiteTestBase
96
96
new Department { Id = 30 , Name = "Dept 3" } ,
97
97
} ;
98
98
99
- public static Employee [ ] SeedEmployees = new [ ]
99
+ public static DeptEmployee [ ] SeedEmployees = new [ ]
100
100
{
101
- new Employee { Id = 1 , DepartmentId = 10 , FirstName = "First 1" , LastName = "Last 1" } ,
102
- new Employee { Id = 2 , DepartmentId = 20 , FirstName = "First 2" , LastName = "Last 2" } ,
103
- new Employee { Id = 3 , DepartmentId = 30 , FirstName = "First 3" , LastName = "Last 3" } ,
101
+ new DeptEmployee { Id = 1 , DepartmentId = 10 , FirstName = "First 1" , LastName = "Last 1" } ,
102
+ new DeptEmployee { Id = 2 , DepartmentId = 20 , FirstName = "First 2" , LastName = "Last 2" } ,
103
+ new DeptEmployee { Id = 3 , DepartmentId = 30 , FirstName = "First 3" , LastName = "Last 3" } ,
104
104
} ;
105
105
106
106
[ Test ]
@@ -197,15 +197,15 @@ public void Does_only_populate_Select_fields()
197
197
{
198
198
using ( var db = OpenDbConnection ( ) )
199
199
{
200
- db . DropTable < Employee > ( ) ;
200
+ db . DropTable < DeptEmployee > ( ) ;
201
201
db . DropTable < Department > ( ) ;
202
202
db . CreateTable < Department > ( ) ;
203
- db . CreateTable < Employee > ( ) ;
203
+ db . CreateTable < DeptEmployee > ( ) ;
204
204
205
205
db . InsertAll ( SeedDepartments ) ;
206
206
db . InsertAll ( SeedEmployees ) ;
207
207
208
- var q = db . From < Employee > ( )
208
+ var q = db . From < DeptEmployee > ( )
209
209
. Join < Department > ( )
210
210
. Select ( new [ ] { "departmentid" } ) ;
211
211
@@ -214,7 +214,7 @@ public void Does_only_populate_Select_fields()
214
214
Assert . That ( results . All ( x => x . Id == 0 ) ) ;
215
215
Assert . That ( results . All ( x => x . DepartmentId >= 10 ) ) ;
216
216
217
- q = db . From < Employee > ( )
217
+ q = db . From < DeptEmployee > ( )
218
218
. Join < Department > ( )
219
219
. Select ( new [ ] { "id" , "departmentid" } ) ;
220
220
@@ -232,17 +232,17 @@ public void Does_only_populate_Select_fields_wildcard()
232
232
{
233
233
using ( var db = OpenDbConnection ( ) )
234
234
{
235
- db . DropTable < Employee > ( ) ;
235
+ db . DropTable < DeptEmployee > ( ) ;
236
236
db . DropTable < Department > ( ) ;
237
237
db . CreateTable < Department > ( ) ;
238
- db . CreateTable < Employee > ( ) ;
238
+ db . CreateTable < DeptEmployee > ( ) ;
239
239
240
240
db . InsertAll ( SeedDepartments ) ;
241
241
db . InsertAll ( SeedEmployees ) ;
242
242
243
- var q = db . From < Employee > ( )
243
+ var q = db . From < DeptEmployee > ( )
244
244
. Join < Department > ( )
245
- . Select ( new [ ] { "departmentid" , "employee .*" } ) ;
245
+ . Select ( new [ ] { "departmentid" , "deptemployee .*" } ) ;
246
246
247
247
Assert . That ( q . OnlyFields , Is . EquivalentTo ( new [ ] {
248
248
"departmentid" , "Id" , "FirstName" , "LastName"
@@ -254,7 +254,7 @@ public void Does_only_populate_Select_fields_wildcard()
254
254
Assert . That ( results . All ( x => x . FirstName != null ) ) ;
255
255
Assert . That ( results . All ( x => x . LastName != null ) ) ;
256
256
257
- q = db . From < Employee > ( )
257
+ q = db . From < DeptEmployee > ( )
258
258
. Join < Department > ( )
259
259
. Select ( new [ ] { "departmentid" , "department" , "department.*" } ) ;
260
260
@@ -276,15 +276,15 @@ public void Does_only_populate_LoadSelect_fields()
276
276
{
277
277
using ( var db = OpenDbConnection ( ) )
278
278
{
279
- db . DropTable < Employee > ( ) ;
279
+ db . DropTable < DeptEmployee > ( ) ;
280
280
db . DropTable < Department > ( ) ;
281
281
db . CreateTable < Department > ( ) ;
282
- db . CreateTable < Employee > ( ) ;
282
+ db . CreateTable < DeptEmployee > ( ) ;
283
283
284
284
db . InsertAll ( SeedDepartments ) ;
285
285
db . InsertAll ( SeedEmployees ) ;
286
286
287
- var q = db . From < Employee > ( )
287
+ var q = db . From < DeptEmployee > ( )
288
288
. Join < Department > ( )
289
289
. Select ( new [ ] { "departmentid" } ) ;
290
290
@@ -294,7 +294,7 @@ public void Does_only_populate_LoadSelect_fields()
294
294
Assert . That ( results . All ( x => x . Id == 0 ) ) ;
295
295
Assert . That ( results . All ( x => x . DepartmentId >= 10 ) ) ;
296
296
297
- q = db . From < Employee > ( )
297
+ q = db . From < DeptEmployee > ( )
298
298
. Join < Department > ( )
299
299
. Select ( new [ ] { "id" , "departmentid" } ) ;
300
300
0 commit comments