/// <summary> /// Execute Terms query /// </summary> /// <typeparam name="TModel">Return Model type</typeparam> /// <param name="db">IWpDb</param> /// <param name="w">IUnitOfWork</param> /// <param name="opt">Function to return query options</param> public static Task <Maybe <IEnumerable <TModel> > > ExecuteAsync <TModel>(IWpDb db, IUnitOfWork w, GetTermsOptions opt) where TModel : IWithId <WpTermId> => F.Some( () => opt(new TermsOptions(db.Schema)), e => new M.ErrorGettingQueryTermsOptionsMsg(e) ) .Bind( x => x.ToParts <TModel>() ) .BindAsync( x => db.Query.QueryAsync <TModel>(x, w.Transaction) );
/// <inheritdoc/> public Task <Maybe <IEnumerable <T> > > ExecuteAsync <T>(IWpDb db, IUnitOfWork w, GetTermsOptions opt) where T : IWithId <WpTermId> => QueryTermsF.ExecuteAsync <T>(db, w, opt);