예제 #1
0
            public Blob(StorageBlobType blobType, byte[] contents, IDictionary <string, string> metadata, string leaseId,
                        DateTime?leaseExpires)
            {
                if (blobType == StorageBlobType.PageBlob && contents.Length % 512 != 0)
                {
                    throw new InvalidOperationException();
                }

                _blobType     = blobType;
                _contents     = new byte[contents.LongLength];
                _eTag         = Guid.NewGuid().ToString();
                _lastModified = DateTimeOffset.Now;
                Array.Copy(contents, _contents, _contents.LongLength);
                _metadata    = new Dictionary <string, string>(metadata);
                LeaseId      = leaseId;
                LeaseExpires = leaseExpires;
            }
            public Blob(StorageBlobType blobType, byte[] contents, IDictionary<string, string> metadata, string leaseId,
                DateTime? leaseExpires)
            {
                if (blobType == StorageBlobType.PageBlob && contents.Length % 512 != 0)
                {
                    throw new InvalidOperationException();
                }

                _blobType = blobType;
                _contents = new byte[contents.LongLength];
                _eTag = Guid.NewGuid().ToString();
                _lastModified = DateTimeOffset.Now;
                Array.Copy(contents, _contents, _contents.LongLength);
                _metadata = new Dictionary<string, string>(metadata);
                LeaseId = leaseId;
                LeaseExpires = leaseExpires;
            }