Пример #1
0
        public Block FindFirstBlock()
        {
            var min = _blocks.Min("Height");

            if (min.AsInt64 > 0)
            {
                return(_blocks.FindOne(Query.EQ("Height", min.AsInt64)));
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
        private void MinMaxCommon(LiteCollection <DateTimeTest> coll)
        {
            var searchdatetime = new DateTime(2018, 02, 22, 0, 0, 10);

            var min = coll.Min(x => x.Date).AsDateTime;
            var max = coll.Max(x => x.Date).AsDateTime;

            var smaller = coll.FindOne(x => x.Date < searchdatetime);
            var greater = coll.FindOne(x => x.Date > searchdatetime);

            var all = coll.FindAll().ToList();

            var linqmin = all.Min(x => x.Date);
            var linqmax = all.Max(x => x.Date);

            Assert.AreEqual(min, linqmin);
            Assert.AreEqual(max, linqmax);
        }
 public BsonValue Min()
 {
     return(_collection.Min());
 }
Пример #4
0
 public BsonValue Min()
 {
     return(LiteCollection.Min());
 }