Mongodb c# driver and ISODate

前端 未结 2 1840
广开言路
广开言路 2021-01-18 10:08

I have the following test that passes:

namespace MongoDateTest
{

    [TestFixture]
    public class DateTesting
    {
        public class TestEntity
               


        
2条回答
  •  天命终不由人
    2021-01-18 10:33

    You could also do this in your model. public class TestEntity

    {
        public string Id { get; set; }
    
        public string StringTest { get; set; }
    
        [BsonDateTimeOptions(Kind = DateTimeKind.Utc)]
        public DateTime DateTest { get; set; }
    }
    

提交回复
热议问题