public static EnhancedVideoDbContext Create(string connectionString)
        {
            var optionsBuilder = new DbContextOptionsBuilder <EnhancedVideoDbContext>();

            optionsBuilder.UseMySql(connectionString);

            //Ensure database creation
            var context = new EnhancedVideoDbContext(optionsBuilder.Options);

            //context.Database.EnsureCreated();

            return(context);
        }
Exemple #2
0
 public EnhancedVideoDbRepository(IVideoDbRepository videoDbRepo, EnhancedVideoDbContext enhancedVideoDbContext, IEnhancedVideoDbOptions options)
 {
     _videoDbRepo            = videoDbRepo;
     _enhancedVideoDbContext = enhancedVideoDbContext;
     _options = options;
 }