/// <inheritdoc /> public long DeleteAmortizations(IQueryCompunded <IDistributedQueryAtom> filter) { var res = m_Amortizations.DeleteMany(filter.Accept(new MongoDbNativeDistributed <Amortization>())); return(res.DeletedCount); }
/// <inheritdoc /> public IEnumerable <Amortization> SelectAmortizations(IQueryCompunded <IDistributedQueryAtom> filter) => m_Amortizations.FindSync(filter.Accept(new MongoDbNativeDistributed <Amortization>())) .ToEnumerable();
/// <inheritdoc /> public IEnumerable <Asset> SelectAssets(IQueryCompunded <IDistributedQueryAtom> filter) => m_Assets.FindSync(filter.Accept(new MongoDbNativeDistributed <Asset>())) .ToEnumerable();
/// <inheritdoc /> public long DeleteVouchers(IQueryCompunded <IVoucherQueryAtom> query) { var res = m_Vouchers.DeleteMany(query.Accept(new MongoDbNativeVoucher())); return(res.DeletedCount); }
/// <inheritdoc /> public IEnumerable <Voucher> SelectVouchers(IQueryCompunded <IVoucherQueryAtom> query) => m_Vouchers.Find(query.Accept(new MongoDbNativeVoucher())).Sort(Builders <Voucher> .Sort.Ascending("date")) .ToEnumerable();
/// <summary> /// 判断一般检索式是否成立 /// </summary> /// <param name="query">检索式</param> /// <param name="atomPredictor">原子检索式成立条件</param> /// <returns>是否成立</returns> public static bool IsMatch <TAtom>(IQueryCompunded <TAtom> query, Func <TAtom, bool> atomPredictor) where TAtom : class => query?.Accept(new MatchHelperVisitor <TAtom>(atomPredictor)) ?? true;