DocSpace-buildtools/common/ASC.Core.Common/EF/Context/TelegramDbContext.cs

35 lines
907 B
C#
Raw Normal View History


using ASC.Common;
using ASC.Core.Common.EF.Model;
using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF.Context
{
public class TelegramDbContext : BaseDbContext
{
public DbSet<TelegramUser> Users { get; set; }
public TelegramDbContext() { }
public TelegramDbContext(DbContextOptions<TelegramDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
ModelBuilderWrapper
.From(modelBuilder, Provider)
2020-10-05 10:11:15 +00:00
.AddTelegramUsers();
}
}
public static class TelegramDbContextExtension
{
public static DIHelper AddTelegramDbContextService(this DIHelper services)
{
return services.AddDbContextManagerService<TelegramDbContext>();
}
}
}