Skip to content

Commit f9c38e9

Browse files
author
Serdar Ozler
committed
Windows Azure Storage Client 2.0.2 Hotfix
1 parent be17b8c commit f9c38e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1904
-337
lines changed

microsoft-azure-api/Services/Storage/Lib/Common/Shared/Protocol/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ internal class HeaderConstants
605605
/// <summary>
606606
/// Specifies the value to use for UserAgent header.
607607
/// </summary>
608-
public const string UserAgentProductVersion = "2.0.1";
608+
public const string UserAgentProductVersion = "2.0.2";
609609

610610
/// <summary>
611611
/// Master Windows Azure Storage header prefix.

microsoft-azure-api/Services/Storage/Lib/Common/Table/DynamicTableEntity.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public DynamicTableEntity()
4040
/// <param name="partitionKey">The partition key value for the entity.</param>
4141
/// <param name="rowKey">The row key value for the entity.</param>
4242
public DynamicTableEntity(string partitionKey, string rowKey)
43-
: this(partitionKey, rowKey, DateTime.MinValue, null /* timestamp */, new Dictionary<string, EntityProperty>())
43+
: this(partitionKey, rowKey, DateTimeOffset.MinValue, null /* timestamp */, new Dictionary<string, EntityProperty>())
4444
{
4545
}
4646

@@ -53,7 +53,7 @@ public DynamicTableEntity(string partitionKey, string rowKey)
5353
/// <param name="properties">The entity's properties, indexed by property name.</param>
5454
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "This is consistent with IDictionary<> itself.")]
5555
public DynamicTableEntity(string partitionKey, string rowKey, string etag, IDictionary<string, EntityProperty> properties)
56-
: this(partitionKey, rowKey, DateTime.MinValue, etag, properties)
56+
: this(partitionKey, rowKey, DateTimeOffset.MinValue, etag, properties)
5757
{
5858
}
5959

@@ -65,7 +65,7 @@ public DynamicTableEntity(string partitionKey, string rowKey, string etag, IDict
6565
/// <param name="timestamp">The timestamp for this entity as returned by Windows Azure.</param>
6666
/// <param name="etag">The entity's current ETag; set to null to ignore the ETag during subsequent update operations.</param>
6767
/// <param name="properties">An <see cref="IDictionary{TKey,TElement}"/> containg a map of <see cref="string"/> property names to <see cref="EntityProperty"/> data typed values to store in the new <see cref="DynamicTableEntity"/>.</param>
68-
internal DynamicTableEntity(string partitionKey, string rowKey, DateTime timestamp, string etag, IDictionary<string, EntityProperty> properties)
68+
internal DynamicTableEntity(string partitionKey, string rowKey, DateTimeOffset timestamp, string etag, IDictionary<string, EntityProperty> properties)
6969
{
7070
CommonUtils.AssertNotNull("partitionKey", partitionKey);
7171
CommonUtils.AssertNotNull("rowKey", rowKey);

microsoft-azure-api/Services/Storage/Lib/Common/Table/EntityProperty.cs

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static EntityProperty GeneratePropertyForByteArray(
8181
/// </summary>
8282
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
8383
/// <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)
8585
{
8686
return new EntityProperty(input);
8787
}
@@ -91,7 +91,7 @@ public static EntityProperty GeneratePropertyForBool(bool input)
9191
/// </summary>
9292
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
9393
/// <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)
9595
{
9696
return new EntityProperty(input);
9797
}
@@ -101,7 +101,7 @@ public static EntityProperty GeneratePropertyForDouble(double input)
101101
/// </summary>
102102
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
103103
/// <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)
105105
{
106106
return new EntityProperty(input);
107107
}
@@ -111,7 +111,7 @@ public static EntityProperty GeneratePropertyForGuid(Guid input)
111111
/// </summary>
112112
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
113113
/// <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)
115115
{
116116
return new EntityProperty(input);
117117
}
@@ -121,7 +121,7 @@ public static EntityProperty GeneratePropertyForInt(int input)
121121
/// </summary>
122122
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
123123
/// <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)
125125
{
126126
return new EntityProperty(input);
127127
}
@@ -166,9 +166,10 @@ public static EntityProperty GeneratePropertyForString(string input)
166166
#else
167167
public
168168
#endif
169-
EntityProperty(bool input)
169+
EntityProperty(bool? input)
170170
: this(EdmType.Boolean)
171171
{
172+
this.IsNull = !input.HasValue;
172173
this.PropertyAsObject = input;
173174
}
174175

@@ -224,9 +225,10 @@ public static EntityProperty GeneratePropertyForString(string input)
224225
#else
225226
public
226227
#endif
227-
EntityProperty(double input)
228+
EntityProperty(double? input)
228229
: this(EdmType.Double)
229230
{
231+
this.IsNull = !input.HasValue;
230232
this.PropertyAsObject = input;
231233
}
232234

@@ -240,9 +242,10 @@ public static EntityProperty GeneratePropertyForString(string input)
240242
#else
241243
public
242244
#endif
243-
EntityProperty(Guid input)
245+
EntityProperty(Guid? input)
244246
: this(EdmType.Guid)
245247
{
248+
this.IsNull = !input.HasValue;
246249
this.PropertyAsObject = input;
247250
}
248251

@@ -256,9 +259,10 @@ public static EntityProperty GeneratePropertyForString(string input)
256259
#else
257260
public
258261
#endif
259-
EntityProperty(int input)
262+
EntityProperty(int? input)
260263
: this(EdmType.Int32)
261264
{
265+
this.IsNull = !input.HasValue;
262266
this.PropertyAsObject = input;
263267
}
264268

@@ -272,9 +276,10 @@ public static EntityProperty GeneratePropertyForString(string input)
272276
#else
273277
public
274278
#endif
275-
EntityProperty(long input)
279+
EntityProperty(long? input)
276280
: this(EdmType.Int64)
277281
{
282+
this.IsNull = !input.HasValue;
278283
this.PropertyAsObject = input;
279284
}
280285

@@ -334,18 +339,19 @@ public byte[] BinaryValue
334339
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Boolean"/> Object.
335340
/// </summary>
336341
/// <value>The <see cref="Boolean"/> value of this <see cref="EntityProperty"/> object.</value>
337-
public bool BooleanValue
342+
public bool? BooleanValue
338343
{
339344
get
340345
{
341346
this.EnforceType(EdmType.Boolean);
342-
return (bool)this.PropertyAsObject;
347+
return (bool?)this.PropertyAsObject;
343348
}
344349

345350
set
346351
{
347352
this.EnforceType(EdmType.Boolean);
348353
this.PropertyAsObject = value;
354+
this.IsNull = value.HasValue;
349355
}
350356
}
351357

@@ -399,18 +405,19 @@ public DateTimeOffset? DateTimeOffsetValue
399405
/// An exception will be thrown if you attempt to set this property to anything other than a <see cref="Double"/> object.
400406
/// </summary>
401407
/// <value>The <see cref="Double"/> value of this <see cref="EntityProperty"/> object.</value>
402-
public double DoubleValue
408+
public double? DoubleValue
403409
{
404410
get
405411
{
406412
this.EnforceType(EdmType.Double);
407-
return (double)this.PropertyAsObject;
413+
return (double?)this.PropertyAsObject;
408414
}
409415

410416
set
411417
{
412418
this.EnforceType(EdmType.Double);
413419
this.PropertyAsObject = value;
420+
this.IsNull = value.HasValue;
414421
}
415422
}
416423

@@ -419,18 +426,19 @@ public double DoubleValue
419426
/// An exception will be thrown if you attempt to set this property to anything other than a <see cref="Guid"/> object.
420427
/// </summary>
421428
/// <value>The <see cref="Guid"/> value of this <see cref="EntityProperty"/> object.</value>
422-
public Guid GuidValue
429+
public Guid? GuidValue
423430
{
424431
get
425432
{
426433
this.EnforceType(EdmType.Guid);
427-
return (Guid)this.PropertyAsObject;
434+
return (Guid?)this.PropertyAsObject;
428435
}
429436

430437
set
431438
{
432439
this.EnforceType(EdmType.Guid);
433440
this.PropertyAsObject = value;
441+
this.IsNull = value.HasValue;
434442
}
435443
}
436444

@@ -439,18 +447,19 @@ public Guid GuidValue
439447
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Int32"/> Object.
440448
/// </summary>
441449
/// <value>The <see cref="Int32"/> value of this <see cref="EntityProperty"/> object.</value>
442-
public int Int32Value
450+
public int? Int32Value
443451
{
444452
get
445453
{
446454
this.EnforceType(EdmType.Int32);
447-
return (int)this.PropertyAsObject;
455+
return (int?)this.PropertyAsObject;
448456
}
449457

450458
set
451459
{
452460
this.EnforceType(EdmType.Int32);
453461
this.PropertyAsObject = value;
462+
this.IsNull = value.HasValue;
454463
}
455464
}
456465

@@ -459,18 +468,19 @@ public int Int32Value
459468
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Int64"/> Object.
460469
/// </summary>
461470
/// <value>The <see cref="Int64"/> value of this <see cref="EntityProperty"/> object.</value>
462-
public long Int64Value
471+
public long? Int64Value
463472
{
464473
get
465474
{
466475
this.EnforceType(EdmType.Int64);
467-
return (long)this.PropertyAsObject;
476+
return (long?)this.PropertyAsObject;
468477
}
469478

470479
set
471480
{
472481
this.EnforceType(EdmType.Int64);
473482
this.PropertyAsObject = value;
483+
this.IsNull = value.HasValue;
474484
}
475485
}
476486

@@ -564,6 +574,10 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
564574
{
565575
return new EntityProperty((bool)value);
566576
}
577+
else if (value is bool?)
578+
{
579+
return new EntityProperty((bool?)value);
580+
}
567581
else if (value is DateTime)
568582
{
569583
return new EntityProperty((DateTime)value);
@@ -584,6 +598,14 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
584598
{
585599
return new EntityProperty((double)value);
586600
}
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+
}
587609
else if (value is Guid)
588610
{
589611
return new EntityProperty((Guid)value);
@@ -592,10 +614,18 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
592614
{
593615
return new EntityProperty((int)value);
594616
}
617+
else if (value is int?)
618+
{
619+
return new EntityProperty((int?)value);
620+
}
595621
else if (value is long)
596622
{
597623
return new EntityProperty((long)value);
598624
}
625+
else if (value is long?)
626+
{
627+
return new EntityProperty((long?)value);
628+
}
599629
else if (value == null)
600630
{
601631
return new EntityProperty((string)null);

0 commit comments

Comments
 (0)