mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
14 lines
359 B
C#
14 lines
359 B
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Kruzya.TelegramBot.Core.Extensions;
|
|
|
|
public static partial class RepositoryExtension
|
|
{
|
|
public static TEntity Create<TEntity>(this DbSet<TEntity> repository) where TEntity : class, new()
|
|
{
|
|
var entity = new TEntity();
|
|
repository.Add(entity);
|
|
|
|
return entity;
|
|
}
|
|
} |