Beispiel #1
0
 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));
 }
Beispiel #2
0
 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));
 }
Beispiel #3
0
 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));
 }
Beispiel #4
0
 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);
 }
Beispiel #5
0
 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));
 }
Beispiel #7
0
 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));
 }