dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.64k stars 25.29k forks source link

Does this work with ASP.NET Core 2.0 #9009

Closed phatcher closed 6 years ago

phatcher commented 6 years ago

The sample code is ASP.NET Core 1.0, please update to latest


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

guardrex commented 6 years ago

Hello @phatcher ... It's tracked by the sample update tracking issue. We'll get to it as soon as we can. 🏃

https://github.com/aspnet/Docs/issues/5495

Basel78 commented 5 years ago

I am trying to use EF6.0 in Class Library Project .Net Framework 4.6.2 (Repository project) where the DBCcntext live in and the Entities been created in different project(.NET framework 4.6.2) using Reverse Code First POCO, The Repository been called thru another (framework 4.6.2) Manager Project referenced inside ASPNET Core 2.0 SPA Project, where StructureMap used as IoC, The first thing I faced was the issue of Passing the connectionstring to the DBContext inside Repository Project, as I want to Register the services (DBContext,Repository) inside the Repository Project not from the ASPNET Core Startup.cs, the reason to that is to VOID exposing the DBContext to the frontend project, anyway I ended up hard-coding the connection string in Repo Project temporarily.

The main issue that I am facing now is when the request go from the controller to get the Products,, it reach to the Repository Project where the Linq statement use _dbcontext.Product , then error message thrown

NotSupportedException: Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.

The Entityframework is registered inside Repository project, but not inside ASPNET Core 2.0 Project which shows Nuget conflict error when install it in the last one. also I installed "System.Data.SqlClient" from Nuget in ASPNET Core2.0 but still throwing the same error.

guardrex commented 5 years ago

Hello @Basel78 ... You'll get a faster answer on a support forum, such as Stack Overflow, or a support chat, such as Gitter or Slack. There are only a few doc authors on this repo, and we don't have the staffing to handle support requests ... only documentation issues. If there's a problem with a topic, please use the Content feedback button at the bottom of the topic to open a new issue.