public static Task <PKGroup> UpdateGroup(this IPKConnection conn, GroupId id, GroupPatch patch) { var(query, pms) = patch.Apply(UpdateQueryBuilder.Update("groups", "id = @id")) .WithConstant("id", id) .Build("returning *"); return(conn.QueryFirstAsync <PKGroup>(query, pms)); }
public static Task <PKMember> UpdateMember(this IPKConnection conn, MemberId id, MemberPatch patch) { var(query, pms) = patch.Apply(UpdateQueryBuilder.Update("members", "id = @id")) .WithConstant("id", id) .Build("returning *"); return(conn.QueryFirstAsync <PKMember>(query, pms)); }
public static Task <PKSystem> UpdateSystem(this IPKConnection conn, SystemId id, SystemPatch patch) { var(query, pms) = patch.Apply(UpdateQueryBuilder.Update("systems", "id = @id")) .WithConstant("id", id) .Build("returning *"); return(conn.QueryFirstAsync <PKSystem>(query, pms)); }
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); }
public Task <PKMember> UpdateMember(IPKConnection conn, MemberId id, MemberPatch patch, IDbTransaction?transaction = null) { _logger.Information("Updated {MemberId}: {@MemberPatch}", id, patch); var(query, pms) = patch.Apply(UpdateQueryBuilder.Update("members", "id = @id")) .WithConstant("id", id) .Build("returning *"); return(conn.QueryFirstAsync <PKMember>(query, pms, transaction)); }
public Task <PKSystem> UpdateSystem(IPKConnection conn, SystemId id, SystemPatch patch) { _logger.Information("Updated {SystemId}: {@SystemPatch}", id, patch); var(query, pms) = patch.Apply(UpdateQueryBuilder.Update("systems", "id = @id")) .WithConstant("id", id) .Build("returning *"); return(conn.QueryFirstAsync <PKSystem>(query, pms)); }
public Task <PKGroup> UpdateGroup(IPKConnection conn, GroupId id, GroupPatch patch) { _logger.Information("Updated {GroupId}: {@GroupPatch}", id, patch); var(query, pms) = patch.Apply(UpdateQueryBuilder.Update("groups", "id = @id")) .WithConstant("id", id) .Build("returning *"); return(conn.QueryFirstAsync <PKGroup>(query, pms)); }