Extract system/member guild settings and refactor DB access
(also refactor MemberAvatar now that I'm here)
This commit is contained in:
@@ -311,6 +311,11 @@ namespace PluralKit.Core
|
||||
|
||||
public static class DatabaseExt
|
||||
{
|
||||
public static async Task Execute(this DbConnectionFactory db, Func<IDbConnection, Task> func)
|
||||
{
|
||||
await using var conn = await db.Obtain();
|
||||
await func(conn);
|
||||
}
|
||||
public static async Task<T> Execute<T>(this DbConnectionFactory db, Func<IDbConnection, Task<T>> func)
|
||||
{
|
||||
await using var conn = await db.Obtain();
|
||||
|
Reference in New Issue
Block a user