mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 10:18:27 -04:00
- Database namespace is now NadekoBot.Db
- Db related code is now in src/NadekoBot/Db - Finished major part of the db refactor, but many optimizations are left to be made
This commit is contained in:
12
src/NadekoBot/Db/Extensions/DbExtensions.cs
Normal file
12
src/NadekoBot/Db/Extensions/DbExtensions.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NadekoBot.Core.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