/// <summary>
 ///     判断一般检索式是否成立
 /// </summary>
 /// <param name="query">检索式</param>
 /// <param name="atomPredictor">原子检索式成立条件</param>
 /// <returns>是否成立</returns>
 public static bool IsMatch <TAtom>(IQueryCompounded <TAtom> query, Func <TAtom, bool> atomPredictor)
     where TAtom : class => query?.Accept(new MatchHelperVisitor <TAtom>(atomPredictor)) ?? true;
示例#2
0
        /// <inheritdoc />
        public long DeleteAmortizations(IQueryCompounded <IDistributedQueryAtom> filter)
        {
            var res = m_Amortizations.DeleteMany(filter.Accept(new MongoDbNativeDistributed <Amortization>()));

            return(res.DeletedCount);
        }
示例#3
0
        /// <inheritdoc />
        public long DeleteVouchers(IQueryCompounded <IVoucherQueryAtom> query)
        {
            var res = m_Vouchers.DeleteMany(query.Accept(new MongoDbNativeVoucher()));

            return(res.DeletedCount);
        }
示例#4
0
 /// <inheritdoc />
 public IEnumerable <Amortization> SelectAmortizations(IQueryCompounded <IDistributedQueryAtom> filter) =>
 m_Amortizations.FindSync(filter.Accept(new MongoDbNativeDistributed <Amortization>()))
 .ToEnumerable();
示例#5
0
 /// <inheritdoc />
 public IEnumerable <Voucher> SelectVouchers(IQueryCompounded <IVoucherQueryAtom> query) =>
 m_Vouchers.Find(query.Accept(new MongoDbNativeVoucher())).Sort(Builders <Voucher> .Sort.Ascending("date"))
 .ToEnumerable();