This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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