26 lines
794 B
C#
26 lines
794 B
C#
using Chatbot.Api.Domain.Data.EntityTypeConfiguration;
|
|
using Chatbot.Api.Domain.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Chatbot.Api.Domain.Data.DbContexts
|
|
{
|
|
public class SessionDbContext : DbContext
|
|
{
|
|
public DbSet<BotSession> BotSessions { get; set; }
|
|
|
|
public SessionDbContext(DbContextOptions<SessionDbContext> options)
|
|
: base(options)
|
|
{
|
|
base.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;
|
|
base.ChangeTracker.AutoDetectChangesEnabled = true;
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
modelBuilder.ApplyConfiguration(new BotSessionConfiguration());
|
|
}
|
|
}
|
|
}
|