using System.Threading.Tasks; using Kruzya.TelegramBot.Core.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; namespace Kruzya.TelegramBot.Core.Extensions { public static partial class RepositoryExtension { public static TEntity Create(this DbSet repository) where TEntity : class, new() { var entity = new TEntity(); repository.Add(entity); return entity; } } }