Beispiel #1
0
 public static Task <PKGroup?> QueryGroupByName(this IPKConnection conn, SystemId system, string name) =>
 conn.QueryFirstOrDefaultAsync <PKGroup?>("select * from groups where system = @System and lower(Name) = lower(@Name)", new { System = system, Name = name });
Beispiel #2
0
 public static Task <PKGroup?> QueryGroupByHid(this IPKConnection conn, string hid) =>
 conn.QueryFirstOrDefaultAsync <PKGroup?>("select * from groups where hid = @hid", new { hid = hid.ToLowerInvariant() });
Beispiel #3
0
 public static Task <PKMember?> QueryMember(this IPKConnection conn, MemberId id) =>
 conn.QueryFirstOrDefaultAsync <PKMember?>("select * from members where id = @id", new { id });
Beispiel #4
0
 public static Task <PKSystem?> QuerySystem(this IPKConnection conn, SystemId id) =>
 conn.QueryFirstOrDefaultAsync <PKSystem?>("select * from systems where id = @id", new { id });
Beispiel #5
0
 public static Task <MessageContext> QueryMessageContext(this IPKConnection conn, ulong account, ulong guild, ulong channel)
 {
     return(conn.QueryFirstOrDefaultAsync <MessageContext>("message_context",
                                                           new { account_id = account, guild_id = guild, channel_id = channel },
                                                           commandType: CommandType.StoredProcedure));
 }
Beispiel #6
0
 public Task <PKMember?> GetMemberByDisplayName(IPKConnection conn, SystemId system, string name) =>
 conn.QueryFirstOrDefaultAsync <PKMember?>("select * from members where lower(display_name) = lower(@Name) and system = @SystemID", new { Name = name, SystemID = system });
 public Task <PKGroup?> GetGroupByDisplayName(IPKConnection conn, SystemId system, string display_name) =>
 conn.QueryFirstOrDefaultAsync <PKGroup?>("select * from groups where system = @System and lower(display_name) = lower(@Name)", new { System = system, Name = display_name });