Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Commented Feature: Allow DbContext to be created with an already-open existing connection plus ensure connection closing is consistent with opening [45]

$
0
0
This item was migrated from the DevDiv work item tracking system [ID=7992]. <br />
Comments: Using opened connection would be very useful when using EF with System.Data.SQLite. This provider have a function "SetPassword" which allow to open encrypted database without putting the password into the connection string. This must to be call before Open(). I have found no way to use this function outside or inside my DbContext. The only way is to include the password into the connection string. I've tried to use SetPassword: - before the DbContext constructor: fail - after on mySQLiteConnection object: fail - after on dbContext.Database.Connection: fail One thing could work, I need a callback (event) on the DbContext when EF open the connection (OnBeforeOpen) so I could call SetPassword here. Thanks.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>