对象类
namespace BigDtaHandler_Test
{
[BsonIgnoreExtraElements]
class ActiveWin
{
public string ActID { get; set; }
public string ActWinName { get; set; }
public DateTime ActWinDate { get; set; }
public double ActWintime { get; set; }
}
}
**Program Class**
static void CallMain()
{
_client = new MongoClient();
_database = _client.GetDatabase("CaptureEmployee");
var collectionGet = _database.GetCollection<ActiveWin>("ActiveWindow");
var filter = new BsonDocument();
var result = collectionGet.Find(filter).ToList();
}
当我从MongoDB集合中检索数据时,此结果列表中的ActiveDate显示为“0001-01-01 12:00:00”,非常有价值。我如何从数据库中获得正确的DateTime?