mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
15 lines
398 B
C#
15 lines
398 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;
|
|
}
|
|
}
|
|
} |