New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default(DateTime) causes ArgumentOutOfRangeException #4
Comments
Can you post your test case ? |
Here is basically what happened:
To get past the issue I changed the code as follows:
|
I used the following code to test on two of my device(win,mac(mono)), the document is successfully created. I can not use your code to test because there is no Database class, and insert a document throws an error with finding class name. using (var database = Settings.GetDatabase())
{
DateTime dateOfBirth = default(DateTime);
database
.Create
.Vertex<OVertex>()
.Set("date", dateOfBirth)
.Run();
} and using (var database = Settings.GetDatabase())
{
DateTime dateOfBirth = default(DateTime);
var doc = new OVertex();
doc.SetField("Date", dateOfBirth);
var doc1 = database.Create.Document<OVertex>(doc).Run();
} |
I was using the document model, not the graph model. That might be the difference. Although I did not check this for quite some time. I'll revisit this. |
OrientDB has issue with date's < 1582-10-14 |
…edge-in-transaction Feature remove edge in transaction
* Fix typo preceeded * Fix typo somtimes
When working with DateTime and setting values to its default value using default(DateTime) this results in a ArgumentOutOfRangeException. Here is the stack trace:
From what I could see it is caused by the conversion to UNIX timestamp. I currently do not have the time to investigate, but at the point where the DateTime field is converted to UNIX Timestamp there should be a check if the field value matches default(DateTime).
Revision used: master 5102043
Quick update:
Insert operations succeeded despite those exceptions being thrown.
The text was updated successfully, but these errors were encountered: