public async Task MoveSwitch(IPKConnection conn, SwitchId id, Instant time) { await conn.ExecuteAsync("update switches set timestamp = @Time where id = @Id", new { Time = time, Id = id }); _logger.Information("Updated {SwitchId} timestamp: {SwitchTimestamp}", id, time); }
public async Task DeleteSwitch(IPKConnection conn, SwitchId id) { await conn.ExecuteAsync("delete from switches where id = @Id", new { Id = id }); _logger.Information("Deleted {Switch}", id); }
public IAsyncEnumerable <PKMember> GetSwitchMembers(IPKConnection conn, SwitchId sw) { return(conn.QueryStreamAsync <PKMember>( "select * from switch_members, members where switch_members.member = members.id and switch_members.switch = @Switch order by switch_members.id", new { Switch = sw })); }