-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Win Server 2008.
.NET 3.5
Create a date, save it, retrieve it back and the DateTime.CompareTo() function says that they are not equal. All inner fields are equal except for the Ticks field.
Not sure if it matters, but doing everything in SafeMode, and the date property is decorated with [BsonDateTimeOptions(Kind = DateTimeKind.Local)].
Steps to reproduce:
-------------------------------
var myItem = new Item(...);
var myDate = DateTime.Now;
myItem.date = myDate;
// this assert is passes.
Assert.AreEqual(0, myDate.CompareTo(myItem.date));
myCollection<Item>.Save(myItem, SafeMode.True);
// query the db to get the same object that is myItem.
var savedAndRetrievedMyItem = myCollection.FindOneAs(...);
// this assert fails.
Assert.AreEqual(0, myDate.CompareTo(savedAndRetrievedMyItem.date));