femto-backend/Femto.Modules.Blog/Data/BlogContext.cs
2025-05-04 21:46:24 +02:00

19 lines
No EOL
665 B
C#

using Femto.Modules.Blog.Domain.Posts;
using Femto.Modules.Blog.Infrastructure.Integration;
using Femto.Modules.Blog.Infrastructure.Integration.Outbox;
using Microsoft.EntityFrameworkCore;
namespace Femto.Modules.Blog.Data;
internal class BlogContext(DbContextOptions<BlogContext> options) : DbContext(options)
{
public virtual DbSet<Post> Posts { get; set; }
public virtual DbSet<OutboxEntry> Outbox { get; set; }
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.HasDefaultSchema("blog");
builder.ApplyConfigurationsFromAssembly(typeof(BlogContext).Assembly);
}
}