Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 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 }));
 }