예제 #1
0
 /// <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)
     );
예제 #2
0
 /// <inheritdoc/>
 public Task <Maybe <IEnumerable <T> > > ExecuteAsync <T>(IWpDb db, IUnitOfWork w, GetTermsOptions opt)
     where T : IWithId <WpTermId> =>
 QueryTermsF.ExecuteAsync <T>(db, w, opt);