Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class SampleDbContextFactory : IDesignTimeDbContextFactory<SampleDbContext>
{
public SampleDbContext CreateDbContext(string[] args)
{
// Get DbContext from DI system
var resolver = new DependencyResolver
{
CurrentDirectory = Path.Combine(Directory.GetCurrentDirectory(), "../NetCoreLambda")
};
return resolver.ServiceProvider.GetService(typeof(SampleDbContext)) as SampleDbContext;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.