0
eu11111 created
Hey. I am trying to run a bulk insert inside the database. My problem is that I need to us a SqlConnection to do so, inside an AppService. Should I use the Core layer instead?
Anyway, is there a way of accessing th ConnectionString from appsettings.json inside the Web project from another project? Or getting a SqlConnection object from the dbContext or something related?
Thanks in advance
1 Answer(s)
-
0
You can try to create a custom repository (<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/EntityFramework-Integration#DocCustomRepositoryMethods">http://www.aspnetboilerplate.com/Pages/ ... oryMethods</a>) and use Context.Database to directly run SQL commands.