mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
Lots more stuff
This commit is contained in:
12
src/Nadeko.Bot.Db/Extensions/DbExtensions.cs
Normal file
12
src/Nadeko.Bot.Db/Extensions/DbExtensions.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
#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);
|
||||
}
|
Reference in New Issue
Block a user