refactor: move ContextExts to own folder, CommandTree / command defs to CommandMeta folder

This commit is contained in:
spiral
2021-11-26 22:04:04 -05:00
parent 4450ae4214
commit 979ab714c3
9 changed files with 143 additions and 140 deletions

View File

@@ -87,12 +87,12 @@ public static class ContextListExt
return p;
}
public static async Task RenderMemberList(this Context ctx, LookupContext lookupCtx, IDatabase db,
public static async Task RenderMemberList(this Context ctx, LookupContext lookupCtx,
SystemId system, string embedTitle, string color, MemberListOptions opts)
{
// We take an IDatabase instead of a IPKConnection so we don't keep the handle open for the entire runtime
// We wanna release it as soon as the member list is actually *fetched*, instead of potentially minutes later (paginate timeout)
var members = (await db.Execute(conn => conn.QueryMemberList(system, opts.ToQueryOptions())))
var members = (await ctx.Database.Execute(conn => conn.QueryMemberList(system, opts.ToQueryOptions())))
.SortByMemberListOptions(opts, lookupCtx)
.ToList();