Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Add connectionstring in ASP.NET5.0 with EF7 for using dll repository library(based on EF6)

$
0
0

If it is EF7 DbContext, in asp.net 5.0 project configure as:


services.AddEntityFramework()
.AddSqlServer()
.AddDbContext(options =>
options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));

How about configure the connectionstring for EF6 DbContext?

BTW, in previous projects, only need to add connectionStrings element in app.config or web.config. But set in web.config of asp.net 5.0 project, it still

does not work. It will use the default like below:

"Data Source=.\\SQLEXPRESS;Initial Catalog=connectionStringName;Integrated Security=True;MultipleActiveResultSets=True"


Viewing all articles
Browse latest Browse all 9386

Trending Articles



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