PluralKit/PluralKit.Core/Database/Repository/ModelRepository.Context.cs

25 lines
856 B
C#
Raw Normal View History

2021-08-27 15:03:47 +00:00
using System.Collections.Generic;
using System.Data;
using System.Threading.Tasks;
using Dapper;
namespace PluralKit.Core
{
2020-08-29 11:46:27 +00:00
public partial class ModelRepository
{
2020-08-29 11:46:27 +00:00
public Task<MessageContext> GetMessageContext(IPKConnection conn, ulong account, ulong guild, ulong channel)
{
2021-08-27 15:03:47 +00:00
return conn.QueryFirstAsync<MessageContext>("message_context",
new { account_id = account, guild_id = guild, channel_id = channel },
commandType: CommandType.StoredProcedure);
2021-08-27 15:03:47 +00:00
}
2020-08-29 11:46:27 +00:00
public Task<IEnumerable<ProxyMember>> GetProxyMembers(IPKConnection conn, ulong account, ulong guild)
{
2021-08-27 15:03:47 +00:00
return conn.QueryAsync<ProxyMember>("proxy_members",
new { account_id = account, guild_id = guild },
commandType: CommandType.StoredProcedure);
2021-08-27 15:03:47 +00:00
}
}
}