Permalink
Browse files

Merge pull request #134 from sozler/dev

Windows Azure Storage Client 2.0.2 Hotfix
  • Loading branch information...
2 parents 00d46d1 + cb12ecc commit 331c4f413e0c3ae7df4e2d12bb09303ca29929af Abdelrahman Elogeel committed Dec 5, 2012
Showing with 1,910 additions and 344 deletions.
  1. +6 −7 README.md
  2. +1 −1 microsoft-azure-api/Services/Storage/Lib/Common/Shared/Protocol/Constants.cs
  3. +3 −3 microsoft-azure-api/Services/Storage/Lib/Common/Table/DynamicTableEntity.cs
  4. +50 −20 microsoft-azure-api/Services/Storage/Lib/Common/Table/EntityProperty.cs
  5. +79 −77 microsoft-azure-api/Services/Storage/Lib/Common/Table/TableEntity.cs
  6. +1 −1 microsoft-azure-api/Services/Storage/Lib/DotNet40/Properties/AssemblyInfo.cs
  7. +4 −4 microsoft-azure-api/Services/Storage/Lib/DotNet40/Table/CloudTable.cs
  8. +6 −10 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Blob/BlobReadStream.cs
  9. +46 −47 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Blob/BlobWriteStream.cs
  10. +3 −0 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Blob/CloudBlobClient.cs
  11. +4 −6 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Blob/CloudBlobContainer.cs
  12. +12 −4 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Blob/CloudBlockBlob.cs
  13. +14 −5 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Blob/CloudPageBlob.cs
  14. +3 −3 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Core/Executor/Executor.cs
  15. +1 −1 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Core/Executor/TableExecutor.cs
  16. +3 −3 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Core/Util/AsyncStreamCopier.cs
  17. +11 −9 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Core/Util/StorageCommandAsyncResult.cs
  18. +4 −4 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Queue/CloudQueue.cs
  19. +1 −1 microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Table/DataServices/TableServiceContext.cs
  20. +13 −2 microsoft-azure-api/Services/Storage/Lib/RT/Properties/AssemblyInfo.cs
  21. +1 −1 microsoft-azure-api/Services/Storage/Lib/RTTable/Properties/AssemblyInfo.cs
  22. +1 −1 microsoft-azure-api/Services/Storage/Test/Unit/DotNet40/Properties/AssemblyInfo.cs
  23. +149 −20 microsoft-azure-api/Services/Storage/Test/Unit/DotNet40/Table/Entities/ComplexEntity.cs
  24. +32 −2 microsoft-azure-api/Services/Storage/Test/Unit/DotNet40/Table/TableBatchOperationTest.cs
  25. +129 −3 microsoft-azure-api/Services/Storage/Test/Unit/DotNet40/Table/TableOperationUnitTests.cs
  26. +59 −0 microsoft-azure-api/Services/Storage/Test/Unit/DotNet40/Table/TableQueryGenericTests.cs
  27. +9 −9 microsoft-azure-api/Services/Storage/Test/Unit/DotNet40/Table/TableQueryTests.cs
  28. +2 −2 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/BlobManglerUnitTests.cs
  29. +2 −6 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/BlobReadStreamTest.cs
  30. +91 −1 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/CloudBlobClientTest.cs
  31. +69 −0 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/CloudBlobContainerTest.cs
  32. +11 −0 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/CloudBlobDirectoryTest.cs
  33. +212 −0 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/CloudBlockBlobTest.cs
  34. +187 −0 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/CloudPageBlobTest.cs
  35. +3 −3 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/MD5FlagsTest.cs
  36. +24 −29 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Blob/SASTests.cs
  37. +20 −0 microsoft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Queue/CloudQueueTest.cs
  38. +215 −0 ...soft-azure-api/Services/Storage/Test/Unit/DotNetCommon/Table/DataServices/TableEntityUnitTests.cs
  39. +4 −4 ...re-api/Services/Storage/Test/Unit/DotNetCommon/Table/DataServices/TableServiceContextUnitTests.cs
  40. +2 −6 microsoft-azure-api/Services/Storage/Test/Unit/RT/Blob/BlobReadStreamTest.cs
  41. +0 −5 microsoft-azure-api/Services/Storage/Test/Unit/RT/Blob/CloudBlobContainerTest.cs
  42. +18 −3 microsoft-azure-api/Services/Storage/Test/Unit/RT/Blob/CloudBlobDirectoryTest.cs
  43. +95 −0 microsoft-azure-api/Services/Storage/Test/Unit/RT/Blob/CloudBlockBlobTest.cs
  44. +85 −0 microsoft-azure-api/Services/Storage/Test/Unit/RT/Blob/CloudPageBlobTest.cs
  45. +24 −29 microsoft-azure-api/Services/Storage/Test/Unit/RT/Blob/SASTests.cs
  46. +1 −1 microsoft-azure-api/Services/Storage/Test/Unit/RT/Properties/AssemblyInfo.cs
  47. +169 −0 microsoft-azure-api/Services/Storage/Test/Unit/RT/Table/Entities/ComplexEntity.cs
  48. +11 −1 microsoft-azure-api/Services/Storage/Test/Unit/RT/Table/TableBatchOperationTest.cs
  49. +11 −1 microsoft-azure-api/Services/Storage/Test/Unit/RT/Table/TableOperationUnitTests.cs
  50. +9 −9 microsoft-azure-api/Services/Storage/Test/Unit/RT/Table/TableQueryTests.cs
View
@@ -1,4 +1,4 @@
-<h1>Windows Azure SDK for Windows 8 and .NET 4(2.0.0.0)</h1>
+<h1>Windows Azure SDK for Windows 8 and .NET 4 (2.0.2)</h1>
<p>This SDK allows you to build Windows Azure applications that take advantage of
Azure scalable cloud computing resources: table and blob storage, messaging through
Service Bus, distributed caching through cache.</p>
@@ -49,7 +49,7 @@ within your project you can also have them installed by the .NET package manager
<h2>Dependencies</h2>
<p>
-The 2.0.0.0 version depends on three libraries (collectively referred to as ODataLib), which are resolved through the ODataLib (version 5.0.2) packages available through NuGet and not the WCF Data Services installer which currently contains 5.0.0 versions.
+The 2.0.2 version depends on three libraries (collectively referred to as ODataLib), which are resolved through the ODataLib (version 5.0.2) packages available through NuGet and not the WCF Data Services installer which currently contains 5.0.0 versions.
The ODataLib libraries can be downloaded directly or referenced by your code project through NuGet.
The specific ODataLib packages are:<br/>
http://nuget.org/packages/Microsoft.Data.OData/5.0.2<br/>
@@ -60,22 +60,21 @@ http://nuget.org/packages/System.Spatial/5.0.2<br/>
<h2>Code Samples</h2>
<p>Note:</p>
<ul>
- <li>All code samples are available under the <code>/samples</code> folder.</li>
<li>How-Tos focused around accomplishing specific tasks are available on the
<a href="http://www.windowsazure.com/en-us/develop/net/">Windows Azure .NET
Developer Center</a>.</li>
</ul>
-<p>First, include the classes you need (in this case we'll include the StorageClient
+<p>First, include the classes you need (in this case we'll include the Storage and Table
and further demonstrate creating a table):<br/>
-<pre>using Microsoft.WindowsAzure;
-using Microsoft.WindowsAzure.StorageClient;</pre></p>
+<pre>using Microsoft.WindowsAzure.Storage;
+using Microsoft.WindowsAzure.Storage.Table;</pre></p>
<p>To perform an operation on any Windows Azure resource you will first instantiate
a <strong>client</strong> which allows performing actions on it. The resource is known as an
<strong>entity</strong>. To do so for Table you also have to authenticate your request:<br/>
<pre>var storageAccount =
- CloudStorageAccount.FromConfigurationSetting("StorageConnectionString");
+ CloudStorageAccount.DevelopmentStorageAccount;
var tableClient = storageAccount.CreateCloudTableClient();</pre></p>
<p>Now, to create a table entity using the client:<br/>
@@ -605,7 +605,7 @@ internal class HeaderConstants
/// <summary>
/// Specifies the value to use for UserAgent header.
/// </summary>
- public const string UserAgentProductVersion = "2.0.1";
+ public const string UserAgentProductVersion = "2.0.2";
/// <summary>
/// Master Windows Azure Storage header prefix.
@@ -40,7 +40,7 @@ public DynamicTableEntity()
/// <param name="partitionKey">The partition key value for the entity.</param>
/// <param name="rowKey">The row key value for the entity.</param>
public DynamicTableEntity(string partitionKey, string rowKey)
- : this(partitionKey, rowKey, DateTime.MinValue, null /* timestamp */, new Dictionary<string, EntityProperty>())
+ : this(partitionKey, rowKey, DateTimeOffset.MinValue, null /* timestamp */, new Dictionary<string, EntityProperty>())
{
}
@@ -53,7 +53,7 @@ public DynamicTableEntity(string partitionKey, string rowKey)
/// <param name="properties">The entity's properties, indexed by property name.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "This is consistent with IDictionary<> itself.")]
public DynamicTableEntity(string partitionKey, string rowKey, string etag, IDictionary<string, EntityProperty> properties)
- : this(partitionKey, rowKey, DateTime.MinValue, etag, properties)
+ : this(partitionKey, rowKey, DateTimeOffset.MinValue, etag, properties)
{
}
@@ -65,7 +65,7 @@ public DynamicTableEntity(string partitionKey, string rowKey, string etag, IDict
/// <param name="timestamp">The timestamp for this entity as returned by Windows Azure.</param>
/// <param name="etag">The entity's current ETag; set to null to ignore the ETag during subsequent update operations.</param>
/// <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>
- internal DynamicTableEntity(string partitionKey, string rowKey, DateTime timestamp, string etag, IDictionary<string, EntityProperty> properties)
+ internal DynamicTableEntity(string partitionKey, string rowKey, DateTimeOffset timestamp, string etag, IDictionary<string, EntityProperty> properties)
{
CommonUtils.AssertNotNull("partitionKey", partitionKey);
CommonUtils.AssertNotNull("rowKey", rowKey);
@@ -81,7 +81,7 @@ public static EntityProperty GeneratePropertyForDateTimeOffset(DateTimeOffset? i
/// </summary>
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Boolean"/> type.</returns>
- public static EntityProperty GeneratePropertyForBool(bool input)
+ public static EntityProperty GeneratePropertyForBool(bool? input)
{
return new EntityProperty(input);
}
@@ -91,7 +91,7 @@ public static EntityProperty GeneratePropertyForBool(bool input)
/// </summary>
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Double"/> type.</returns>
- public static EntityProperty GeneratePropertyForDouble(double input)
+ public static EntityProperty GeneratePropertyForDouble(double? input)
{
return new EntityProperty(input);
}
@@ -101,7 +101,7 @@ public static EntityProperty GeneratePropertyForDouble(double input)
/// </summary>
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Guid"/> type.</returns>
- public static EntityProperty GeneratePropertyForGuid(Guid input)
+ public static EntityProperty GeneratePropertyForGuid(Guid? input)
{
return new EntityProperty(input);
}
@@ -111,7 +111,7 @@ public static EntityProperty GeneratePropertyForGuid(Guid input)
/// </summary>
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Int32"/> type.</returns>
- public static EntityProperty GeneratePropertyForInt(int input)
+ public static EntityProperty GeneratePropertyForInt(int? input)
{
return new EntityProperty(input);
}
@@ -121,7 +121,7 @@ public static EntityProperty GeneratePropertyForInt(int input)
/// </summary>
/// <param name="input">The value for the new <see cref="EntityProperty"/>.</param>
/// <returns>A new <see cref="EntityProperty"/> of the <see cref="Int64"/> type.</returns>
- public static EntityProperty GeneratePropertyForLong(long input)
+ public static EntityProperty GeneratePropertyForLong(long? input)
{
return new EntityProperty(input);
}
@@ -166,9 +166,10 @@ public static EntityProperty GeneratePropertyForString(string input)
#else
public
#endif
- EntityProperty(bool input)
+ EntityProperty(bool? input)
: this(EdmType.Boolean)
{
+ this.IsNull = !input.HasValue;
this.PropertyAsObject = input;
}
@@ -224,9 +225,10 @@ public static EntityProperty GeneratePropertyForString(string input)
#else
public
#endif
- EntityProperty(double input)
+ EntityProperty(double? input)
: this(EdmType.Double)
{
+ this.IsNull = !input.HasValue;
this.PropertyAsObject = input;
}
@@ -240,9 +242,10 @@ public static EntityProperty GeneratePropertyForString(string input)
#else
public
#endif
- EntityProperty(Guid input)
+ EntityProperty(Guid? input)
: this(EdmType.Guid)
{
+ this.IsNull = !input.HasValue;
this.PropertyAsObject = input;
}
@@ -256,9 +259,10 @@ public static EntityProperty GeneratePropertyForString(string input)
#else
public
#endif
- EntityProperty(int input)
+ EntityProperty(int? input)
: this(EdmType.Int32)
{
+ this.IsNull = !input.HasValue;
this.PropertyAsObject = input;
}
@@ -272,9 +276,10 @@ public static EntityProperty GeneratePropertyForString(string input)
#else
public
#endif
- EntityProperty(long input)
+ EntityProperty(long? input)
: this(EdmType.Int64)
{
+ this.IsNull = !input.HasValue;
this.PropertyAsObject = input;
}
@@ -334,18 +339,19 @@ public byte[] BinaryValue
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Boolean"/> Object.
/// </summary>
/// <value>The <see cref="Boolean"/> value of this <see cref="EntityProperty"/> object.</value>
- public bool BooleanValue
+ public bool? BooleanValue
{
get
{
this.EnforceType(EdmType.Boolean);
- return (bool)this.PropertyAsObject;
+ return (bool?)this.PropertyAsObject;
}
set
{
this.EnforceType(EdmType.Boolean);
this.PropertyAsObject = value;
+ this.IsNull = value.HasValue;
}
}
@@ -399,18 +405,19 @@ public bool BooleanValue
/// An exception will be thrown if you attempt to set this property to anything other than a <see cref="Double"/> object.
/// </summary>
/// <value>The <see cref="Double"/> value of this <see cref="EntityProperty"/> object.</value>
- public double DoubleValue
+ public double? DoubleValue
{
get
{
this.EnforceType(EdmType.Double);
- return (double)this.PropertyAsObject;
+ return (double?)this.PropertyAsObject;
}
set
{
this.EnforceType(EdmType.Double);
this.PropertyAsObject = value;
+ this.IsNull = value.HasValue;
}
}
@@ -419,18 +426,19 @@ public double DoubleValue
/// An exception will be thrown if you attempt to set this property to anything other than a <see cref="Guid"/> object.
/// </summary>
/// <value>The <see cref="Guid"/> value of this <see cref="EntityProperty"/> object.</value>
- public Guid GuidValue
+ public Guid? GuidValue
{
get
{
this.EnforceType(EdmType.Guid);
- return (Guid)this.PropertyAsObject;
+ return (Guid?)this.PropertyAsObject;
}
set
{
this.EnforceType(EdmType.Guid);
this.PropertyAsObject = value;
+ this.IsNull = value.HasValue;
}
}
@@ -439,18 +447,19 @@ public Guid GuidValue
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Int32"/> Object.
/// </summary>
/// <value>The <see cref="Int32"/> value of this <see cref="EntityProperty"/> object.</value>
- public int Int32Value
+ public int? Int32Value
{
get
{
this.EnforceType(EdmType.Int32);
- return (int)this.PropertyAsObject;
+ return (int?)this.PropertyAsObject;
}
set
{
this.EnforceType(EdmType.Int32);
this.PropertyAsObject = value;
+ this.IsNull = value.HasValue;
}
}
@@ -459,18 +468,19 @@ public int Int32Value
/// An exception will be thrown if you attempt to set this property to anything other than an <see cref="Int64"/> Object.
/// </summary>
/// <value>The <see cref="Int64"/> value of this <see cref="EntityProperty"/> object.</value>
- public long Int64Value
+ public long? Int64Value
{
get
{
this.EnforceType(EdmType.Int64);
- return (long)this.PropertyAsObject;
+ return (long?)this.PropertyAsObject;
}
set
{
this.EnforceType(EdmType.Int64);
this.PropertyAsObject = value;
+ this.IsNull = value.HasValue;
}
}
@@ -564,6 +574,10 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
{
return new EntityProperty((bool)value);
}
+ else if (value is bool?)
+ {
+ return new EntityProperty((bool?)value);
+ }
else if (value is DateTime)
{
return new EntityProperty((DateTime)value);
@@ -584,6 +598,14 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
{
return new EntityProperty((double)value);
}
+ else if (value is double?)
+ {
+ return new EntityProperty((double?)value);
+ }
+ else if (value is Guid?)
+ {
+ return new EntityProperty((Guid?)value);
+ }
else if (value is Guid)
{
return new EntityProperty((Guid)value);
@@ -592,10 +614,18 @@ internal static EntityProperty CreateEntityPropertyFromObject(object value, bool
{
return new EntityProperty((int)value);
}
+ else if (value is int?)
+ {
+ return new EntityProperty((int?)value);
+ }
else if (value is long)
{
return new EntityProperty((long)value);
}
+ else if (value is long?)
+ {
+ return new EntityProperty((long?)value);
+ }
else if (value == null)
{
return new EntityProperty((string)null);
Oops, something went wrong.

0 comments on commit 331c4f4

Please sign in to comment.