Files
nadekobot/src/NadekoBot/Db/Extensions/NadekoExpressionExtensions.cs
2023-02-28 14:49:50 +01:00

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();
}