SSWConsulting/SSW.VerticalSliceArchitecture

Apply model config from assembly

Hona opened this issue ยท 0 comments

Hona commented

Change code to

namespace TempusHub.API.Common;

public partial class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }

    // ๐Ÿ‘‡ New code
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
    }
    // ๐Ÿ‘† New code
}