Esempio n. 1
0
        public override bool Expire(DateTime ExpiredAfter)
        {
            var removedCount = LCol.Delete(x => x.ExpireDate < ExpiredAfter);

            //CurrentCollectionCount -= removedCount;
            return(true);
        }
        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public virtual void Delete(IUpdateEntry entry)
        {
            var key   = CreateKey(entry);
            var value = _docrows.FindById(new BsonValue(key));

            if (value != null)
            {
                _docrows.Delete(new BsonValue(key));
            }
            else
            {
                throw new DbUpdateConcurrencyException(LiteDBStrings.UpdateConcurrencyException, new[] { entry });
            }
        }