Json.NET
Code Coverage Statistics for Source File

Newtonsoft.Json.Tests\LinqToSql\LinqToSqlClasses.designer.cs

Symbol Coverage: 73.24% (104 of 142)

Branch Coverage: 60.24% (50 of 83)

Cyclomatic Complexity Avg: 1.59 Max:5

Code Lines: 224


L V Source
1
#pragma warning disable 1591
2
//------------------------------------------------------------------------------
3
// <auto-generated>
4
//     This code was generated by a tool.
5
//     Runtime Version:4.0.30319.1
6
//
7
//     Changes to this file may cause incorrect behavior and will be lost if
8
//     the code is regenerated.
9
// </auto-generated>
10
//------------------------------------------------------------------------------
11

  
12
namespace Newtonsoft.Json.Tests.LinqToSql
13
{
14
	using System.Data.Linq;
15
	using System.Data.Linq.Mapping;
16
	using System.Data;
17
	using System.Collections.Generic;
18
	using System.Reflection;
19
	using System.Linq;
20
	using System.Linq.Expressions;
21
	using System.ComponentModel;
22
	using System;
23
	
24
	
25
	public partial class LinqToSqlClassesDataContext : System.Data.Linq.DataContext
26
	{
27
		
28
 0
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
29
		
30
    #region Extensibility Method Definitions
31
    partial void OnCreated();
32
    partial void InsertPerson(Person instance);
33
    partial void UpdatePerson(Person instance);
34
    partial void DeletePerson(Person instance);
35
    partial void InsertRole(Role instance);
36
    partial void UpdateRole(Role instance);
37
    partial void DeleteRole(Role instance);
38
    partial void InsertPersonRole(PersonRole instance);
39
    partial void UpdatePersonRole(PersonRole instance);
40
    partial void DeletePersonRole(PersonRole instance);
41
    partial void InsertDepartment(Department instance);
42
    partial void UpdateDepartment(Department instance);
43
    partial void DeleteDepartment(Department instance);
44
    #endregion
45
		
46
 0
		public LinqToSqlClassesDataContext(string connection) : 
47
 0
				base(connection, mappingSource)
48
		{
49
			OnCreated();
50
 0
		}
51
		
52
 0
		public LinqToSqlClassesDataContext(System.Data.IDbConnection connection) : 
53
 0
				base(connection, mappingSource)
54
		{
55
			OnCreated();
56
 0
		}
57
		
58
 0
		public LinqToSqlClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
59
 0
				base(connection, mappingSource)
60
		{
61
			OnCreated();
62
 0
		}
63
		
64
 0
		public LinqToSqlClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
65
 0
				base(connection, mappingSource)
66
		{
67
			OnCreated();
68
 0
		}
69
		
70
		public System.Data.Linq.Table<Person> Persons
71
		{
72
			get
73
			{
74
 0
				return this.GetTable<Person>();
75
 0
			}
76
		}
77
		
78
		public System.Data.Linq.Table<Role> Roles
79
		{
80
			get
81
			{
82
 0
				return this.GetTable<Role>();
83
 0
			}
84
		}
85
		
86
		public System.Data.Linq.Table<PersonRole> PersonRoles
87
		{
88
			get
89
			{
90
 0
				return this.GetTable<PersonRole>();
91
 0
			}
92
		}
93
		
94
		public System.Data.Linq.Table<Department> Departments
95
		{
96
			get
97
			{
98
 0
				return this.GetTable<Department>();
99
 0
			}
100
		}
101
	}
102
	
103
	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
104
	public partial class Person : INotifyPropertyChanging, INotifyPropertyChanged
105
	{
106
		
107
 1
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
108
		
109
		private string _FirstName;
110
		
111
		private string _LastName;
112
		
113
		private System.Guid _PersonId;
114
		
115
		private System.Guid _DepartmentId;
116
		
117
		private EntitySet<PersonRole> _PersonRoles;
118
		
119
		private EntityRef<Department> _Department;
120
		
121
    #region Extensibility Method Definitions
122
    partial void OnLoaded();
123
    partial void OnValidate(System.Data.Linq.ChangeAction action);
124
    partial void OnCreated();
125
    partial void OnFirstNameChanging(string value);
126
    partial void OnFirstNameChanged();
127
    partial void OnLastNameChanging(string value);
128
    partial void OnLastNameChanged();
129
    partial void OnPersonIdChanging(System.Guid value);
130
    partial void OnPersonIdChanged();
131
    partial void OnDepartmentIdChanging(System.Guid value);
132
    partial void OnDepartmentIdChanged();
133
    #endregion
134
		
135
 2
		public Person()
136
		{
137
 2
			this._PersonRoles = new EntitySet<PersonRole>(new Action<PersonRole>(this.attach_PersonRoles), new Action<PersonRole>(this.detach_PersonRoles));
138
 2
			this._Department = default(EntityRef<Department>);
139
			OnCreated();
140
 2
		}
141
		
142
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FirstName", CanBeNull=false)]
143
		public string FirstName
144
		{
145
			get
146
			{
147
 2
				return this._FirstName;
148
 2
			}
149
			set
150
			{
151
 2
				if ((this._FirstName != value))
152
				{
153
					this.OnFirstNameChanging(value);
154
 2
					this.SendPropertyChanging();
155
 2
					this._FirstName = value;
156
 2
					this.SendPropertyChanged("FirstName");
157
					this.OnFirstNameChanged();
158
				}
159
 2
			}
160
		}
161
		
162
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastName", CanBeNull=false)]
163
		public string LastName
164
		{
165
			get
166
			{
167
 2
				return this._LastName;
168
 2
			}
169
			set
170
			{
171
 2
				if ((this._LastName != value))
172
				{
173
					this.OnLastNameChanging(value);
174
 2
					this.SendPropertyChanging();
175
 2
					this._LastName = value;
176
 2
					this.SendPropertyChanged("LastName");
177
					this.OnLastNameChanged();
178
				}
179
 2
			}
180
		}
181
		
182
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonId", IsPrimaryKey=true)]
183
		public System.Guid PersonId
184
		{
185
			get
186
			{
187
 5
				return this._PersonId;
188
 5
			}
189
			set
190
			{
191
 2
				if ((this._PersonId != value))
192
				{
193
					this.OnPersonIdChanging(value);
194
 2
					this.SendPropertyChanging();
195
 2
					this._PersonId = value;
196
 2
					this.SendPropertyChanged("PersonId");
197
					this.OnPersonIdChanged();
198
				}
199
 2
			}
200
		}
201
		
202
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DepartmentId")]
203
		public System.Guid DepartmentId
204
		{
205
			get
206
			{
207
 1
				return this._DepartmentId;
208
 1
			}
209
			set
210
			{
211
 0
				if ((this._DepartmentId != value))
212
				{
213
 0
					if (this._Department.HasLoadedOrAssignedValue)
214
					{
215
 0
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
216
					}
217
					this.OnDepartmentIdChanging(value);
218
 0
					this.SendPropertyChanging();
219
 0
					this._DepartmentId = value;
220
 0
					this.SendPropertyChanged("DepartmentId");
221
					this.OnDepartmentIdChanged();
222
				}
223
 0
			}
224
		}
225
		
226
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Person_PersonRole", Storage="_PersonRoles", ThisKey="PersonId", OtherKey="PersonId")]
227
		public EntitySet<PersonRole> PersonRoles
228
		{
229
			get
230
			{
231
 10
				return this._PersonRoles;
232
 10
			}
233
			set
234
			{
235
 0
				this._PersonRoles.Assign(value);
236
 0
			}
237
		}
238
		
239
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Department_Person", Storage="_Department", ThisKey="DepartmentId", OtherKey="DepartmentId", IsForeignKey=true)]
240
		public Department Department
241
		{
242
			get
243
			{
244
 3
				return this._Department.Entity;
245
 3
			}
246
			set
247
			{
248
 4
				Department previousValue = this._Department.Entity;
249
 4
				if (((previousValue != value) 
250
 4
							|| (this._Department.HasLoadedOrAssignedValue == false)))
251
				{
252
 2
					this.SendPropertyChanging();
253
 2
					if ((previousValue != null))
254
					{
255
 0
						this._Department.Entity = null;
256
 0
						previousValue.Persons.Remove(this);
257
					}
258
 2
					this._Department.Entity = value;
259
 2
					if ((value != null))
260
					{
261
 2
						value.Persons.Add(this);
262
 2
						this._DepartmentId = value.DepartmentId;
263
					}
264
					else
265
					{
266
 0
						this._DepartmentId = default(System.Guid);
267
					}
268
 2
					this.SendPropertyChanged("Department");
269
				}
270
 4
			}
271
		}
272
		
273
		public event PropertyChangingEventHandler PropertyChanging;
274
		
275
		public event PropertyChangedEventHandler PropertyChanged;
276
		
277
		protected virtual void SendPropertyChanging()
278
		{
279
 10
			if ((this.PropertyChanging != null))
280
			{
281
 0
				this.PropertyChanging(this, emptyChangingEventArgs);
282
			}
283
 10
		}
284
		
285
		protected virtual void SendPropertyChanged(String propertyName)
286
		{
287
 8
			if ((this.PropertyChanged != null))
288
			{
289
 0
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
290
			}
291
 8
		}
292
		
293
		private void attach_PersonRoles(PersonRole entity)
294
		{
295
 2
			this.SendPropertyChanging();
296
 2
			entity.Person = this;
297
 2
		}
298
		
299
		private void detach_PersonRoles(PersonRole entity)
300
		{
301
 0
			this.SendPropertyChanging();
302
 0
			entity.Person = null;
303
 0
		}
304
	}
305
	
306
	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
307
	public partial class Role : INotifyPropertyChanging, INotifyPropertyChanged
308
	{
309
		
310
 1
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
311
		
312
		private string _Name;
313
		
314
		private System.Guid _RoleId;
315
		
316
		private EntitySet<PersonRole> _PersonRoles;
317
		
318
    #region Extensibility Method Definitions
319
    partial void OnLoaded();
320
    partial void OnValidate(System.Data.Linq.ChangeAction action);
321
    partial void OnCreated();
322
    partial void OnNameChanging(string value);
323
    partial void OnNameChanged();
324
    partial void OnRoleIdChanging(System.Guid value);
325
    partial void OnRoleIdChanged();
326
    #endregion
327
		
328
 2
		public Role()
329
		{
330
 2
			this._PersonRoles = new EntitySet<PersonRole>(new Action<PersonRole>(this.attach_PersonRoles), new Action<PersonRole>(this.detach_PersonRoles));
331
			OnCreated();
332
 2
		}
333
		
334
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", CanBeNull=false)]
335
		public string Name
336
		{
337
			get
338
			{
339
 1
				return this._Name;
340
 1
			}
341
			set
342
			{
343
 2
				if ((this._Name != value))
344
				{
345
					this.OnNameChanging(value);
346
 2
					this.SendPropertyChanging();
347
 2
					this._Name = value;
348
 2
					this.SendPropertyChanged("Name");
349
					this.OnNameChanged();
350
				}
351
 2
			}
352
		}
353
		
354
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleId", IsPrimaryKey=true)]
355
		public System.Guid RoleId
356
		{
357
			get
358
			{
359
 4
				return this._RoleId;
360
 4
			}
361
			set
362
			{
363
 2
				if ((this._RoleId != value))
364
				{
365
					this.OnRoleIdChanging(value);
366
 2
					this.SendPropertyChanging();
367
 2
					this._RoleId = value;
368
 2
					this.SendPropertyChanged("RoleId");
369
					this.OnRoleIdChanged();
370
				}
371
 2
			}
372
		}
373
		
374
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Role_PersonRole", Storage="_PersonRoles", ThisKey="RoleId", OtherKey="RoleId")]
375
		public EntitySet<PersonRole> PersonRoles
376
		{
377
			get
378
			{
379
 3
				return this._PersonRoles;
380
 3
			}
381
			set
382
			{
383
 0
				this._PersonRoles.Assign(value);
384
 0
			}
385
		}
386
		
387
		public event PropertyChangingEventHandler PropertyChanging;
388
		
389
		public event PropertyChangedEventHandler PropertyChanged;
390
		
391
		protected virtual void SendPropertyChanging()
392
		{
393
 6
			if ((this.PropertyChanging != null))
394
			{
395
 0
				this.PropertyChanging(this, emptyChangingEventArgs);
396
			}
397
 6
		}
398
		
399
		protected virtual void SendPropertyChanged(String propertyName)
400
		{
401
 4
			if ((this.PropertyChanged != null))
402
			{
403
 0
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
404
			}
405
 4
		}
406
		
407
		private void attach_PersonRoles(PersonRole entity)
408
		{
409
 2
			this.SendPropertyChanging();
410
 2
			entity.Role = this;
411
 2
		}
412
		
413
		private void detach_PersonRoles(PersonRole entity)
414
		{
415
 0
			this.SendPropertyChanging();
416
 0
			entity.Role = null;
417
 0
		}
418
	}
419
	
420
	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
421
	public partial class PersonRole : INotifyPropertyChanging, INotifyPropertyChanged
422
	{
423
		
424
 1
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
425
		
426
		private System.Guid _PersonId;
427
		
428
		private System.Guid _RoleId;
429
		
430
		private System.Guid _PersonRoleId;
431
		
432
		private EntityRef<Person> _Person;
433
		
434
		private EntityRef<Role> _Role;
435
		
436
    #region Extensibility Method Definitions
437
    partial void OnLoaded();
438
    partial void OnValidate(System.Data.Linq.ChangeAction action);
439
    partial void OnCreated();
440
    partial void OnPersonIdChanging(System.Guid value);
441
    partial void OnPersonIdChanged();
442
    partial void OnRoleIdChanging(System.Guid value);
443
    partial void OnRoleIdChanged();
444
    partial void OnPersonRoleIdChanging(System.Guid value);
445
    partial void OnPersonRoleIdChanged();
446
    #endregion
447
		
448
 2
		public PersonRole()
449
		{
450
 2
			this._Person = default(EntityRef<Person>);
451
 2
			this._Role = default(EntityRef<Role>);
452
			OnCreated();
453
 2
		}
454
		
455
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonId")]
456
		public System.Guid PersonId
457
		{
458
			get
459
			{
460
 2
				return this._PersonId;
461
 2
			}
462
			set
463
			{
464
 1
				if ((this._PersonId != value))
465
				{
466
 1
					if (this._Person.HasLoadedOrAssignedValue)
467
					{
468
 0
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
469
					}
470
					this.OnPersonIdChanging(value);
471
 1
					this.SendPropertyChanging();
472
 1
					this._PersonId = value;
473
 1
					this.SendPropertyChanged("PersonId");
474
					this.OnPersonIdChanged();
475
				}
476
 1
			}
477
		}
478
		
479
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleId")]
480
		public System.Guid RoleId
481
		{
482
			get
483
			{
484
 2
				return this._RoleId;
485
 2
			}
486
			set
487
			{
488
 1
				if ((this._RoleId != value))
489
				{
490
 1
					if (this._Role.HasLoadedOrAssignedValue)
491
					{
492
 0
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
493
					}
494
					this.OnRoleIdChanging(value);
495
 1
					this.SendPropertyChanging();
496
 1
					this._RoleId = value;
497
 1
					this.SendPropertyChanged("RoleId");
498
					this.OnRoleIdChanged();
499
				}
500
 1
			}
501
		}
502
		
503
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonRoleId", IsPrimaryKey=true)]
504
		public System.Guid PersonRoleId
505
		{
506
			get
507
			{
508
 1
				return this._PersonRoleId;
509
 1
			}
510
			set
511
			{
512
 2
				if ((this._PersonRoleId != value))
513
				{
514
					this.OnPersonRoleIdChanging(value);
515
 2
					this.SendPropertyChanging();
516
 2
					this._PersonRoleId = value;
517
 2
					this.SendPropertyChanged("PersonRoleId");
518
					this.OnPersonRoleIdChanged();
519
				}
520
 2
			}
521
		}
522
		
523
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Person_PersonRole", Storage="_Person", ThisKey="PersonId", OtherKey="PersonId", IsForeignKey=true)]
524
		public Person Person
525
		{
526
			get
527
			{
528
 1
				return this._Person.Entity;
529
 1
			}
530
			set
531
			{
532
 2
				Person previousValue = this._Person.Entity;
533
 2
				if (((previousValue != value) 
534
 2
							|| (this._Person.HasLoadedOrAssignedValue == false)))
535
				{
536
 2
					this.SendPropertyChanging();
537
 2
					if ((previousValue != null))
538
					{
539
 0
						this._Person.Entity = null;
540
 0
						previousValue.PersonRoles.Remove(this);
541
					}
542
 2
					this._Person.Entity = value;
543
 2
					if ((value != null))
544
					{
545
 2
						value.PersonRoles.Add(this);
546
 2
						this._PersonId = value.PersonId;
547
					}
548
					else
549
					{
550
 0
						this._PersonId = default(System.Guid);
551
					}
552
 2
					this.SendPropertyChanged("Person");
553
				}
554
 2
			}
555
		}
556
		
557
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Role_PersonRole", Storage="_Role", ThisKey="RoleId", OtherKey="RoleId", IsForeignKey=true)]
558
		public Role Role
559
		{
560
			get
561
			{
562
 4
				return this._Role.Entity;
563
 4
			}
564
			set
565
			{
566
 4
				Role previousValue = this._Role.Entity;
567
 4
				if (((previousValue != value) 
568
 4
							|| (this._Role.HasLoadedOrAssignedValue == false)))
569
				{
570
 2
					this.SendPropertyChanging();
571
 2
					if ((previousValue != null))
572
					{
573
 0
						this._Role.Entity = null;
574
 0
						previousValue.PersonRoles.Remove(this);
575
					}
576
 2
					this._Role.Entity = value;
577
 2
					if ((value != null))
578
					{
579
 2
						value.PersonRoles.Add(this);
580
 2
						this._RoleId = value.RoleId;
581
					}
582
					else
583
					{
584
 0
						this._RoleId = default(System.Guid);
585
					}
586
 2
					this.SendPropertyChanged("Role");
587
				}
588
 4
			}
589
		}
590
		
591
		public event PropertyChangingEventHandler PropertyChanging;
592
		
593
		public event PropertyChangedEventHandler PropertyChanged;
594
		
595
		protected virtual void SendPropertyChanging()
596
		{
597
 8
			if ((this.PropertyChanging != null))
598
			{
599
 0
				this.PropertyChanging(this, emptyChangingEventArgs);
600
			}
601
 8
		}
602
		
603
		protected virtual void SendPropertyChanged(String propertyName)
604
		{
605
 8
			if ((this.PropertyChanged != null))
606
			{
607
 0
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
608
			}
609
 8
		}
610
	}
611
	
612
	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
613
	public partial class Department : INotifyPropertyChanging, INotifyPropertyChanged
614
	{
615
		
616
 1
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
617
		
618
		private System.Guid _DepartmentId;
619
		
620
		private string _Name;
621
		
622
		private EntitySet<Person> _Persons;
623
		
624
    #region Extensibility Method Definitions
625
    partial void OnLoaded();
626
    partial void OnValidate(System.Data.Linq.ChangeAction action);
627
    partial void OnCreated();
628
    partial void OnDepartmentIdChanging(System.Guid value);
629
    partial void OnDepartmentIdChanged();
630
    partial void OnNameChanging(string value);
631
    partial void OnNameChanged();
632
    #endregion
633
		
634
 2
		public Department()
635
		{
636
 2
			this._Persons = new EntitySet<Person>(new Action<Person>(this.attach_Persons), new Action<Person>(this.detach_Persons));
637
			OnCreated();
638
 2
		}
639
		
640
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DepartmentId", IsPrimaryKey=true)]
641
		public System.Guid DepartmentId
642
		{
643
			get
644
			{
645
 3
				return this._DepartmentId;
646
 3
			}
647
			set
648
			{
649
 2
				if ((this._DepartmentId != value))
650
				{
651
					this.OnDepartmentIdChanging(value);
652
 2
					this.SendPropertyChanging();
653
 2
					this._DepartmentId = value;
654
 2
					this.SendPropertyChanged("DepartmentId");
655
					this.OnDepartmentIdChanged();
656
				}
657
 2
			}
658
		}
659
		
660
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", CanBeNull=false)]
661
		public string Name
662
		{
663
			get
664
			{
665
 2
				return this._Name;
666
 2
			}
667
			set
668
			{
669
 2
				if ((this._Name != value))
670
				{
671
					this.OnNameChanging(value);
672
 2
					this.SendPropertyChanging();
673
 2
					this._Name = value;
674
 2
					this.SendPropertyChanged("Name");
675
					this.OnNameChanged();
676
				}
677
 2
			}
678
		}
679
		
680
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Department_Person", Storage="_Persons", ThisKey="DepartmentId", OtherKey="DepartmentId")]
681
		public EntitySet<Person> Persons
682
		{
683
			get
684
			{
685
 2
				return this._Persons;
686
 2
			}
687
			set
688
			{
689
 0
				this._Persons.Assign(value);
690
 0
			}
691
		}
692
		
693
		public event PropertyChangingEventHandler PropertyChanging;
694
		
695
		public event PropertyChangedEventHandler PropertyChanged;
696
		
697
		protected virtual void SendPropertyChanging()
698
		{
699
 6
			if ((this.PropertyChanging != null))
700
			{
701
 0
				this.PropertyChanging(this, emptyChangingEventArgs);
702
			}
703
 6
		}
704
		
705
		protected virtual void SendPropertyChanged(String propertyName)
706
		{
707
 4
			if ((this.PropertyChanged != null))
708
			{
709
 0
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
710
			}
711
 4
		}
712
		
713
		private void attach_Persons(Person entity)
714
		{
715
 2
			this.SendPropertyChanging();
716
 2
			entity.Department = this;
717
 2
		}
718
		
719
		private void detach_Persons(Person entity)
720
		{
721
 0
			this.SendPropertyChanging();
722
 0
			entity.Department = null;
723
 0
		}
724
	}
725
}
726
#pragma warning restore 1591