mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
13 lines
526 B
C#
13 lines
526 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using NadekoBot.Db;
|
|
using NadekoBot.Db.Models;
|
|
// todo fix these namespaces. It should only be Nadeko.Bot.Db
|
|
using NadekoBot.Services.Database;
|
|
|
|
namespace NadekoBot.Extensions;
|
|
|
|
public static class DbExtensions
|
|
{
|
|
public static DiscordUser GetOrCreateUser(this DbContext ctx, IUser original, Func<IQueryable<DiscordUser>, IQueryable<DiscordUser>>? includes = null)
|
|
=> ctx.GetOrCreateUser(original.Id, original.Username, original.Discriminator, original.AvatarId, includes);
|
|
} |