Exemplo n.º 1
0
        public static bool Exists(this IStorageBlob blob)
        {
            if (blob == null)
            {
                throw new ArgumentNullException("blob");
            }

            return(blob.ExistsAsync(CancellationToken.None).GetAwaiter().GetResult());
        }
        private static async Task <DateTime?> GetBlobModifiedUtcTimeAsync(IStorageBlob blob, CancellationToken cancellationToken)
        {
            if (!await blob.ExistsAsync(cancellationToken))
            {
                return(null); // no blob, no time.
            }

            var lastModified = blob.Properties.LastModified;

            return(lastModified.HasValue ? (DateTime?)lastModified.Value.UtcDateTime : null);
        }
        private static async Task<DateTime?> GetBlobModifiedUtcTimeAsync(IStorageBlob blob, CancellationToken cancellationToken)
        {
            if (!await blob.ExistsAsync(cancellationToken))
            {
                return null; // no blob, no time.
            }

            var lastModified = blob.Properties.LastModified;
            return lastModified.HasValue ? (DateTime?)lastModified.Value.UtcDateTime : null;
        }