mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
15 lines
517 B
C#
15 lines
517 B
C#
#nullable disable
|
|
using LinqToDB;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using NadekoBot.Services.Database.Models;
|
|
|
|
namespace NadekoBot.Db;
|
|
|
|
public static class NadekoExpressionExtensions
|
|
{
|
|
public static int ClearFromGuild(this DbSet<NadekoExpression> exprs, ulong guildId)
|
|
=> exprs.Delete(x => x.GuildId == guildId);
|
|
|
|
public static IEnumerable<NadekoExpression> ForId(this DbSet<NadekoExpression> exprs, ulong id)
|
|
=> exprs.AsNoTracking().AsQueryable().Where(x => x.GuildId == id).ToList();
|
|
} |