Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing a DateTime value of DateTime.MinValue in azure table storage fails

I am getting an aggregated exception while storing a DateTime value of either null or DateTime.MinValue. How do I store an acceptable default DateTime value in Azure table store?

like image 627
Abhi Avatar asked Jun 17 '15 03:06

Abhi


People also ask

How much data can be stored in a single table storage account in Azure?

A single storage account can store up to 500TB of data and like any other Azure service, users can take advantage of the pay-per-use pricing model.

Which of the following is true for Azure table storage?

It is possible to specify a container and its blob public. D. All of these. Explanation: All the above three statements hold true for Azure Storage.


1 Answers

  1. From MSDN:

Edm.DateTime DateTime A 64-bit value expressed as Coordinated Universal Time (UTC). The supported DateTime range begins from 12:00 midnight, January 1, 1601 A.D. (C.E.), UTC. The range ends at December 31, 9999.

So, the minimum .Net DateTime value you can store in Azure Tables is new DateTime(1601, 1, 1).

But DateTime.MinValue is equal to new DateTime(0001, 01, 01), that's why you can't store it.

  1. null should be ok, if your date time property type is nullable (DateTime?).
like image 95
Vladimir Dorokhov Avatar answered Sep 20 '22 00:09

Vladimir Dorokhov