Files
nadekobot/src/Nadeko.Bot.Db/Extensions/DbExtensions.cs
2023-03-14 15:48:59 +01:00

12 lines
295 B
C#

#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Database.Models;
namespace NadekoBot.Db;
public static class DbExtensions
{
public static T GetById<T>(this DbSet<T> set, int id)
where T : DbEntity
=> set.FirstOrDefault(x => x.Id == id);
}