PluralKit/PluralKit.Core/Database/Repository/ModelRepository.Account.cs
2020-11-22 09:42:40 -05:00

21 lines
595 B
C#

using System.Collections.Generic;
using System.Data;
using System.Threading.Tasks;
using Dapper;
namespace PluralKit.Core
{
public partial class ModelRepository
{
public async Task UpdateAccount(IPKConnection conn, ulong id, AccountPatch patch)
{
_logger.Information("Updated account {accountId}: {@AccountPatch}", id, patch);
var (query, pms) = patch.Apply(UpdateQueryBuilder.Update("accounts", "uid = @uid"))
.WithConstant("uid", id)
.Build();
await conn.ExecuteAsync(query, pms);
}
}
}