/// <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;
/// <inheritdoc /> public long DeleteAmortizations(IQueryCompounded <IDistributedQueryAtom> filter) { var res = m_Amortizations.DeleteMany(filter.Accept(new MongoDbNativeDistributed <Amortization>())); return(res.DeletedCount); }
/// <inheritdoc /> public long DeleteVouchers(IQueryCompounded <IVoucherQueryAtom> query) { var res = m_Vouchers.DeleteMany(query.Accept(new MongoDbNativeVoucher())); return(res.DeletedCount); }
/// <inheritdoc /> public IEnumerable <Amortization> SelectAmortizations(IQueryCompounded <IDistributedQueryAtom> filter) => m_Amortizations.FindSync(filter.Accept(new MongoDbNativeDistributed <Amortization>())) .ToEnumerable();
/// <inheritdoc /> public IEnumerable <Voucher> SelectVouchers(IQueryCompounded <IVoucherQueryAtom> query) => m_Vouchers.Find(query.Accept(new MongoDbNativeVoucher())).Sort(Builders <Voucher> .Sort.Ascending("date")) .ToEnumerable();