This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
/
AllPropertyTypesOptional.generated.cs
605 lines (558 loc) · 17.5 KB
/
AllPropertyTypesOptional.generated.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Testing
{
public partial class AllPropertyTypesOptional
{
partial void Init();
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected AllPropertyTypesOptional()
{
OwnedType = new global::Testing.OwnedType();
Init();
}
/// <summary>
/// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
/// </summary>
public static AllPropertyTypesOptional CreateAllPropertyTypesOptionalUnsafe()
{
return new AllPropertyTypesOptional();
}
/// <summary>
/// Public constructor with required data
/// </summary>
/// <param name="id1"></param>
public AllPropertyTypesOptional(int id1)
{
this.Id1 = id1;
this.OwnedType = new global::Testing.OwnedType();
Init();
}
/// <summary>
/// Static create function (for use in LINQ queries, etc.)
/// </summary>
/// <param name="id1"></param>
public static AllPropertyTypesOptional Create(int id1)
{
return new AllPropertyTypesOptional(id1);
}
/*************************************************************************
* Properties
*************************************************************************/
/// <summary>
/// Backing field for Id
/// </summary>
internal int _Id;
/// <summary>
/// When provided in a partial class, allows value of Id to be changed before setting.
/// </summary>
partial void SetId(int oldValue, ref int newValue);
/// <summary>
/// When provided in a partial class, allows value of Id to be changed before returning.
/// </summary>
partial void GetId(ref int result);
/// <summary>
/// Identity, Indexed, Required
/// </summary>
[Key]
[Required]
public int Id
{
get
{
int value = _Id;
GetId(ref value);
return (_Id = value);
}
protected set
{
int oldValue = _Id;
SetId(oldValue, ref value);
if (oldValue != value)
{
_Id = value;
}
}
}
/// <summary>
/// Backing field for BinaryAttr
/// </summary>
protected byte[] _BinaryAttr;
/// <summary>
/// When provided in a partial class, allows value of BinaryAttr to be changed before setting.
/// </summary>
partial void SetBinaryAttr(byte[] oldValue, ref byte[] newValue);
/// <summary>
/// When provided in a partial class, allows value of BinaryAttr to be changed before returning.
/// </summary>
partial void GetBinaryAttr(ref byte[] result);
public byte[] BinaryAttr
{
get
{
byte[] value = _BinaryAttr;
GetBinaryAttr(ref value);
return (_BinaryAttr = value);
}
set
{
byte[] oldValue = _BinaryAttr;
SetBinaryAttr(oldValue, ref value);
if (oldValue != value)
{
_BinaryAttr = value;
}
}
}
/// <summary>
/// Backing field for BooleanAttr
/// </summary>
protected bool? _BooleanAttr;
/// <summary>
/// When provided in a partial class, allows value of BooleanAttr to be changed before setting.
/// </summary>
partial void SetBooleanAttr(bool? oldValue, ref bool? newValue);
/// <summary>
/// When provided in a partial class, allows value of BooleanAttr to be changed before returning.
/// </summary>
partial void GetBooleanAttr(ref bool? result);
public bool? BooleanAttr
{
get
{
bool? value = _BooleanAttr;
GetBooleanAttr(ref value);
return (_BooleanAttr = value);
}
set
{
bool? oldValue = _BooleanAttr;
SetBooleanAttr(oldValue, ref value);
if (oldValue != value)
{
_BooleanAttr = value;
}
}
}
/// <summary>
/// Backing field for ByteAttr
/// </summary>
protected byte? _ByteAttr;
/// <summary>
/// When provided in a partial class, allows value of ByteAttr to be changed before setting.
/// </summary>
partial void SetByteAttr(byte? oldValue, ref byte? newValue);
/// <summary>
/// When provided in a partial class, allows value of ByteAttr to be changed before returning.
/// </summary>
partial void GetByteAttr(ref byte? result);
public byte? ByteAttr
{
get
{
byte? value = _ByteAttr;
GetByteAttr(ref value);
return (_ByteAttr = value);
}
set
{
byte? oldValue = _ByteAttr;
SetByteAttr(oldValue, ref value);
if (oldValue != value)
{
_ByteAttr = value;
}
}
}
/// <summary>
/// Backing field for DateTimeAttr
/// </summary>
protected DateTime? _DateTimeAttr;
/// <summary>
/// When provided in a partial class, allows value of DateTimeAttr to be changed before setting.
/// </summary>
partial void SetDateTimeAttr(DateTime? oldValue, ref DateTime? newValue);
/// <summary>
/// When provided in a partial class, allows value of DateTimeAttr to be changed before returning.
/// </summary>
partial void GetDateTimeAttr(ref DateTime? result);
public DateTime? DateTimeAttr
{
get
{
DateTime? value = _DateTimeAttr;
GetDateTimeAttr(ref value);
return (_DateTimeAttr = value);
}
set
{
DateTime? oldValue = _DateTimeAttr;
SetDateTimeAttr(oldValue, ref value);
if (oldValue != value)
{
_DateTimeAttr = value;
}
}
}
/// <summary>
/// Backing field for DateTimeOffsetAttr
/// </summary>
protected DateTimeOffset? _DateTimeOffsetAttr;
/// <summary>
/// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before setting.
/// </summary>
partial void SetDateTimeOffsetAttr(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
/// <summary>
/// When provided in a partial class, allows value of DateTimeOffsetAttr to be changed before returning.
/// </summary>
partial void GetDateTimeOffsetAttr(ref DateTimeOffset? result);
public DateTimeOffset? DateTimeOffsetAttr
{
get
{
DateTimeOffset? value = _DateTimeOffsetAttr;
GetDateTimeOffsetAttr(ref value);
return (_DateTimeOffsetAttr = value);
}
set
{
DateTimeOffset? oldValue = _DateTimeOffsetAttr;
SetDateTimeOffsetAttr(oldValue, ref value);
if (oldValue != value)
{
_DateTimeOffsetAttr = value;
}
}
}
/// <summary>
/// Backing field for DecimalAttr
/// </summary>
protected decimal? _DecimalAttr;
/// <summary>
/// When provided in a partial class, allows value of DecimalAttr to be changed before setting.
/// </summary>
partial void SetDecimalAttr(decimal? oldValue, ref decimal? newValue);
/// <summary>
/// When provided in a partial class, allows value of DecimalAttr to be changed before returning.
/// </summary>
partial void GetDecimalAttr(ref decimal? result);
public decimal? DecimalAttr
{
get
{
decimal? value = _DecimalAttr;
GetDecimalAttr(ref value);
return (_DecimalAttr = value);
}
set
{
decimal? oldValue = _DecimalAttr;
SetDecimalAttr(oldValue, ref value);
if (oldValue != value)
{
_DecimalAttr = value;
}
}
}
/// <summary>
/// Backing field for DoubleAttr
/// </summary>
protected double? _DoubleAttr;
/// <summary>
/// When provided in a partial class, allows value of DoubleAttr to be changed before setting.
/// </summary>
partial void SetDoubleAttr(double? oldValue, ref double? newValue);
/// <summary>
/// When provided in a partial class, allows value of DoubleAttr to be changed before returning.
/// </summary>
partial void GetDoubleAttr(ref double? result);
public double? DoubleAttr
{
get
{
double? value = _DoubleAttr;
GetDoubleAttr(ref value);
return (_DoubleAttr = value);
}
set
{
double? oldValue = _DoubleAttr;
SetDoubleAttr(oldValue, ref value);
if (oldValue != value)
{
_DoubleAttr = value;
}
}
}
/// <summary>
/// Backing field for GuidAttr
/// </summary>
protected Guid? _GuidAttr;
/// <summary>
/// When provided in a partial class, allows value of GuidAttr to be changed before setting.
/// </summary>
partial void SetGuidAttr(Guid? oldValue, ref Guid? newValue);
/// <summary>
/// When provided in a partial class, allows value of GuidAttr to be changed before returning.
/// </summary>
partial void GetGuidAttr(ref Guid? result);
public Guid? GuidAttr
{
get
{
Guid? value = _GuidAttr;
GetGuidAttr(ref value);
return (_GuidAttr = value);
}
set
{
Guid? oldValue = _GuidAttr;
SetGuidAttr(oldValue, ref value);
if (oldValue != value)
{
_GuidAttr = value;
}
}
}
/// <summary>
/// Backing field for Int16Attr
/// </summary>
protected short? _Int16Attr;
/// <summary>
/// When provided in a partial class, allows value of Int16Attr to be changed before setting.
/// </summary>
partial void SetInt16Attr(short? oldValue, ref short? newValue);
/// <summary>
/// When provided in a partial class, allows value of Int16Attr to be changed before returning.
/// </summary>
partial void GetInt16Attr(ref short? result);
public short? Int16Attr
{
get
{
short? value = _Int16Attr;
GetInt16Attr(ref value);
return (_Int16Attr = value);
}
set
{
short? oldValue = _Int16Attr;
SetInt16Attr(oldValue, ref value);
if (oldValue != value)
{
_Int16Attr = value;
}
}
}
/// <summary>
/// Backing field for Int32Attr
/// </summary>
protected int? _Int32Attr;
/// <summary>
/// When provided in a partial class, allows value of Int32Attr to be changed before setting.
/// </summary>
partial void SetInt32Attr(int? oldValue, ref int? newValue);
/// <summary>
/// When provided in a partial class, allows value of Int32Attr to be changed before returning.
/// </summary>
partial void GetInt32Attr(ref int? result);
public int? Int32Attr
{
get
{
int? value = _Int32Attr;
GetInt32Attr(ref value);
return (_Int32Attr = value);
}
set
{
int? oldValue = _Int32Attr;
SetInt32Attr(oldValue, ref value);
if (oldValue != value)
{
_Int32Attr = value;
}
}
}
/// <summary>
/// Backing field for Int64Attr
/// </summary>
protected long? _Int64Attr;
/// <summary>
/// When provided in a partial class, allows value of Int64Attr to be changed before setting.
/// </summary>
partial void SetInt64Attr(long? oldValue, ref long? newValue);
/// <summary>
/// When provided in a partial class, allows value of Int64Attr to be changed before returning.
/// </summary>
partial void GetInt64Attr(ref long? result);
public long? Int64Attr
{
get
{
long? value = _Int64Attr;
GetInt64Attr(ref value);
return (_Int64Attr = value);
}
set
{
long? oldValue = _Int64Attr;
SetInt64Attr(oldValue, ref value);
if (oldValue != value)
{
_Int64Attr = value;
}
}
}
/// <summary>
/// Backing field for SingleAttr
/// </summary>
protected Single? _SingleAttr;
/// <summary>
/// When provided in a partial class, allows value of SingleAttr to be changed before setting.
/// </summary>
partial void SetSingleAttr(Single? oldValue, ref Single? newValue);
/// <summary>
/// When provided in a partial class, allows value of SingleAttr to be changed before returning.
/// </summary>
partial void GetSingleAttr(ref Single? result);
public Single? SingleAttr
{
get
{
Single? value = _SingleAttr;
GetSingleAttr(ref value);
return (_SingleAttr = value);
}
set
{
Single? oldValue = _SingleAttr;
SetSingleAttr(oldValue, ref value);
if (oldValue != value)
{
_SingleAttr = value;
}
}
}
/// <summary>
/// Backing field for StringAttr
/// </summary>
protected string _StringAttr;
/// <summary>
/// When provided in a partial class, allows value of StringAttr to be changed before setting.
/// </summary>
partial void SetStringAttr(string oldValue, ref string newValue);
/// <summary>
/// When provided in a partial class, allows value of StringAttr to be changed before returning.
/// </summary>
partial void GetStringAttr(ref string result);
public string StringAttr
{
get
{
string value = _StringAttr;
GetStringAttr(ref value);
return (_StringAttr = value);
}
set
{
string oldValue = _StringAttr;
SetStringAttr(oldValue, ref value);
if (oldValue != value)
{
_StringAttr = value;
}
}
}
/// <summary>
/// Backing field for TimeAttr
/// </summary>
protected TimeSpan? _TimeAttr;
/// <summary>
/// When provided in a partial class, allows value of TimeAttr to be changed before setting.
/// </summary>
partial void SetTimeAttr(TimeSpan? oldValue, ref TimeSpan? newValue);
/// <summary>
/// When provided in a partial class, allows value of TimeAttr to be changed before returning.
/// </summary>
partial void GetTimeAttr(ref TimeSpan? result);
public TimeSpan? TimeAttr
{
get
{
TimeSpan? value = _TimeAttr;
GetTimeAttr(ref value);
return (_TimeAttr = value);
}
set
{
TimeSpan? oldValue = _TimeAttr;
SetTimeAttr(oldValue, ref value);
if (oldValue != value)
{
_TimeAttr = value;
}
}
}
/// <summary>
/// Backing field for Id1
/// </summary>
internal int _Id1;
/// <summary>
/// When provided in a partial class, allows value of Id1 to be changed before setting.
/// </summary>
partial void SetId1(int oldValue, ref int newValue);
/// <summary>
/// When provided in a partial class, allows value of Id1 to be changed before returning.
/// </summary>
partial void GetId1(ref int result);
/// <summary>
/// Identity, Indexed, Required
/// </summary>
[Key]
[Required]
public int Id1
{
get
{
int value = _Id1;
GetId1(ref value);
return (_Id1 = value);
}
set
{
int oldValue = _Id1;
SetId1(oldValue, ref value);
if (oldValue != value)
{
_Id1 = value;
}
}
}
/// <summary>
/// Concurrency token
/// </summary>
[Timestamp]
public Byte[] Timestamp { get; set; }
/*************************************************************************
* Navigation properties
*************************************************************************/
public virtual global::Testing.OwnedType OwnedType { get; set; }
}
}