I have the following structure.
- MyOrg.Api (AspNet Core Web App)
- MoOrg.DataAccess (Containing the DbContext)
I want the Migrations live in the DataAccess Assembly. Ive tried almost every combination of configuration but cant get it work probably.
MyOrg.Api (Startup.cs)
public void ConfigureServices(IServiceCollection services)
{
// default stuff..
services.AddDbContext<MyOrg.DataAccess.MyDatabaseContext>(options =>
{
options.UseSqlite("Filename=./myDbContext.db", b => b.MigrationsAssembly("MyOrg.DataAccess"));
});
}
MyOrg.DataAccess
public class MyDatabaseContext : DbContext
{
public DbSet<Something> Somethings { get; set; }
public MyDatabaseContext(DbContextOptions<MyDatabaseContext> options) : base(options)
{
}
}
How to do it right?