@@ -81,7 +81,7 @@ public static EntityProperty GeneratePropertyForByteArray(
81
81
/// </summary>
82
82
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
83
83
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Boolean"/> type.</returns>
84
- public static EntityProperty GeneratePropertyForBool ( bool input )
84
+ public static EntityProperty GeneratePropertyForBool ( bool ? input )
85
85
{
86
86
return new EntityProperty ( input ) ;
87
87
}
@@ -91,7 +91,7 @@ public static EntityProperty GeneratePropertyForBool(bool input)
91
91
/// </summary>
92
92
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
93
93
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Double"/> type.</returns>
94
- public static EntityProperty GeneratePropertyForDouble ( double input )
94
+ public static EntityProperty GeneratePropertyForDouble ( double ? input )
95
95
{
96
96
return new EntityProperty ( input ) ;
97
97
}
@@ -101,7 +101,7 @@ public static EntityProperty GeneratePropertyForDouble(double input)
101
101
/// </summary>
102
102
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
103
103
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Guid"/> type.</returns>
104
- public static EntityProperty GeneratePropertyForGuid ( Guid input )
104
+ public static EntityProperty GeneratePropertyForGuid ( Guid ? input )
105
105
{
106
106
return new EntityProperty ( input ) ;
107
107
}
@@ -111,7 +111,7 @@ public static EntityProperty GeneratePropertyForGuid(Guid input)
111
111
/// </summary>
112
112
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
113
113
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Int32"/> type.</returns>
114
- public static EntityProperty GeneratePropertyForInt ( int input )
114
+ public static EntityProperty GeneratePropertyForInt ( int ? input )
115
115
{
116
116
return new EntityProperty ( input ) ;
117
117
}
@@ -121,7 +121,7 @@ public static EntityProperty GeneratePropertyForInt(int input)
121
121
/// </summary>
122
122
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
123
123
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Int64"/> type.</returns>
124
- public static EntityProperty GeneratePropertyForLong ( long input )
124
+ public static EntityProperty GeneratePropertyForLong ( long ? input )
125
125
{
126
126
return new EntityProperty ( input ) ;
127
127
}
@@ -166,9 +166,10 @@ public static EntityProperty GeneratePropertyForString(string input)
166
166
#else
167
167
public
168
168
#endif
169
- EntityProperty ( bool input )
169
+ EntityProperty ( bool ? input )
170
170
: this ( EdmType . Boolean )
171
171
{
172
+ this . IsNull = ! input . HasValue ;
172
173
this . PropertyAsObject = input ;
173
174
}
174
175
@@ -224,9 +225,10 @@ public static EntityProperty GeneratePropertyForString(string input)
224
225
#else
225
226
public
226
227
#endif
227
- EntityProperty ( double input )
228
+ EntityProperty ( double ? input )
228
229
: this ( EdmType . Double )
229
230
{
231
+ this . IsNull = ! input . HasValue ;
230
232
this . PropertyAsObject = input ;
231
233
}
232
234
@@ -240,9 +242,10 @@ public static EntityProperty GeneratePropertyForString(string input)
240
242
#else
241
243
public
242
244
#endif
243
- EntityProperty ( Guid input )
245
+ EntityProperty ( Guid ? input )
244
246
: this ( EdmType . Guid )
245
247
{
248
+ this . IsNull = ! input . HasValue ;
246
249
this . PropertyAsObject = input ;
247
250
}
248
251
@@ -256,9 +259,10 @@ public static EntityProperty GeneratePropertyForString(string input)
256
259
#else
257
260
public
258
261
#endif
259
- EntityProperty ( int input )
262
+ EntityProperty ( int ? input )
260
263
: this ( EdmType . Int32 )
261
264
{
265
+ this . IsNull = ! input . HasValue ;
262
266
this . PropertyAsObject = input ;
263
267
}
264
268
@@ -272,9 +276,10 @@ public static EntityProperty GeneratePropertyForString(string input)
272
276
#else
273
277
public
274
278
#endif
275
- EntityProperty ( long input )
279
+ EntityProperty ( long ? input )
276
280
: this ( EdmType . Int64 )
277
281
{
282
+ this . IsNull = ! input . HasValue ;
278
283
this . PropertyAsObject = input ;
279
284
}
280
285
@@ -334,18 +339,19 @@ public byte[] BinaryValue
334
339
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Boolean"/> Object.
335
340
/// </summary>
336
341
/// <value>The <see cref="Boolean"/> value of this <see cref="EntityProperty"/> object.</value>
337
- public bool BooleanValue
342
+ public bool ? BooleanValue
338
343
{
339
344
get
340
345
{
341
346
this . EnforceType ( EdmType . Boolean ) ;
342
- return ( bool ) this . PropertyAsObject ;
347
+ return ( bool ? ) this . PropertyAsObject ;
343
348
}
344
349
345
350
set
346
351
{
347
352
this . EnforceType ( EdmType . Boolean ) ;
348
353
this . PropertyAsObject = value ;
354
+ this . IsNull = value . HasValue ;
349
355
}
350
356
}
351
357
@@ -399,18 +405,19 @@ public DateTimeOffset? DateTimeOffsetValue
399
405
/// An exception will be thrown if you attempt to set this property to anything other than a <see cref="Double"/> object.
400
406
/// </summary>
401
407
/// <value>The <see cref="Double"/> value of this <see cref="EntityProperty"/> object.</value>
402
- public double DoubleValue
408
+ public double ? DoubleValue
403
409
{
404
410
get
405
411
{
406
412
this . EnforceType ( EdmType . Double ) ;
407
- return ( double ) this . PropertyAsObject ;
413
+ return ( double ? ) this . PropertyAsObject ;
408
414
}
409
415
410
416
set
411
417
{
412
418
this . EnforceType ( EdmType . Double ) ;
413
419
this . PropertyAsObject = value ;
420
+ this . IsNull = value . HasValue ;
414
421
}
415
422
}
416
423
@@ -419,18 +426,19 @@ public double DoubleValue
419
426
/// An exception will be thrown if you attempt to set this property to anything other than a <see cref="Guid"/> object.
420
427
/// </summary>
421
428
/// <value>The <see cref="Guid"/> value of this <see cref="EntityProperty"/> object.</value>
422
- public Guid GuidValue
429
+ public Guid ? GuidValue
423
430
{
424
431
get
425
432
{
426
433
this . EnforceType ( EdmType . Guid ) ;
427
- return ( Guid ) this . PropertyAsObject ;
434
+ return ( Guid ? ) this . PropertyAsObject ;
428
435
}
429
436
430
437
set
431
438
{
432
439
this . EnforceType ( EdmType . Guid ) ;
433
440
this . PropertyAsObject = value ;
441
+ this . IsNull = value . HasValue ;
434
442
}
435
443
}
436
444
@@ -439,18 +447,19 @@ public Guid GuidValue
439
447
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Int32"/> Object.
440
448
/// </summary>
441
449
/// <value>The <see cref="Int32"/> value of this <see cref="EntityProperty"/> object.</value>
442
- public int Int32Value
450
+ public int ? Int32Value
443
451
{
444
452
get
445
453
{
446
454
this . EnforceType ( EdmType . Int32 ) ;
447
- return ( int ) this . PropertyAsObject ;
455
+ return ( int ? ) this . PropertyAsObject ;
448
456
}
449
457
450
458
set
451
459
{
452
460
this . EnforceType ( EdmType . Int32 ) ;
453
461
this . PropertyAsObject = value ;
462
+ this . IsNull = value . HasValue ;
454
463
}
455
464
}
456
465
@@ -459,18 +468,19 @@ public int Int32Value
459
468
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Int64"/> Object.
460
469
/// </summary>
461
470
/// <value>The <see cref="Int64"/> value of this <see cref="EntityProperty"/> object.</value>
462
- public long Int64Value
471
+ public long ? Int64Value
463
472
{
464
473
get
465
474
{
466
475
this . EnforceType ( EdmType . Int64 ) ;
467
- return ( long ) this . PropertyAsObject ;
476
+ return ( long ? ) this . PropertyAsObject ;
468
477
}
469
478
470
479
set
471
480
{
472
481
this . EnforceType ( EdmType . Int64 ) ;
473
482
this . PropertyAsObject = value ;
483
+ this . IsNull = value . HasValue ;
474
484
}
475
485
}
476
486
@@ -564,6 +574,10 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
564
574
{
565
575
return new EntityProperty ( ( bool ) value ) ;
566
576
}
577
+ else if ( value is bool ? )
578
+ {
579
+ return new EntityProperty ( ( bool ? ) value ) ;
580
+ }
567
581
else if ( value is DateTime )
568
582
{
569
583
return new EntityProperty ( ( DateTime ) value ) ;
@@ -584,6 +598,14 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
584
598
{
585
599
return new EntityProperty ( ( double ) value ) ;
586
600
}
601
+ else if ( value is double ? )
602
+ {
603
+ return new EntityProperty ( ( double ? ) value ) ;
604
+ }
605
+ else if ( value is Guid ? )
606
+ {
607
+ return new EntityProperty ( ( Guid ? ) value ) ;
608
+ }
587
609
else if ( value is Guid )
588
610
{
589
611
return new EntityProperty ( ( Guid ) value ) ;
@@ -592,10 +614,18 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
592
614
{
593
615
return new EntityProperty ( ( int ) value ) ;
594
616
}
617
+ else if ( value is int ? )
618
+ {
619
+ return new EntityProperty ( ( int ? ) value ) ;
620
+ }
595
621
else if ( value is long )
596
622
{
597
623
return new EntityProperty ( ( long ) value ) ;
598
624
}
625
+ else if ( value is long ? )
626
+ {
627
+ return new EntityProperty ( ( long ? ) value ) ;
628
+ }
599
629
else if ( value == null )
600
630
{
601
631
return new EntityProperty ( ( string ) null ) ;
0 commit comments