File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
eFormAPI/eFormAPI.Web/Hosting/Helpers Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ public static List<IEformPlugin> GetPlugins(IConfiguration configuration)
2525 {
2626 // Load info from database
2727 List < EformPlugin > eformPlugins = null ;
28- var newPlugins = new List < EformPlugin > ( ) ;
2928 var contextFactory = new BaseDbContextFactory ( ) ;
3029 using ( var dbContext = contextFactory . CreateDbContext ( new [ ] { configuration . MyConnectionString ( ) } ) )
3130 {
@@ -71,17 +70,19 @@ public static List<IEformPlugin> GetPlugins(IConfiguration configuration)
7170 {
7271 var pluginDbName = $ "Database={ dbPrefix } _{ plugin . PluginId } ;";
7372 var pluginConnectionString = connectionString . Replace ( dbNameSection , pluginDbName ) ;
74- newPlugins . Add ( new EformPlugin ( )
73+ var newPlugin = new EformPlugin ( )
7574 {
7675 PluginId = plugin . PluginId ,
7776 ConnectionString = pluginConnectionString ,
78- Status = ( int ) PluginStatus . Disabled
79- } ) ;
77+ Status = ( int ) PluginStatus . Enabled
78+ } ;
79+ dbContext . EformPlugins . Add ( newPlugin ) ;
80+ dbContext . SaveChanges ( ) ;
81+ plugins . Add ( plugin ) ;
8082 }
8183 }
8284
83- dbContext . EformPlugins . AddRange ( newPlugins ) ;
84- dbContext . SaveChanges ( ) ;
85+
8586 }
8687 }
8788
You can’t perform that action at this time.
0 commit comments