I've recently started using VS2022 Community Edition Version 17.4.4 after using VS2017 Enterprise Edition for many years. I've started a new project after selecting ASP.Net Core Web App using MVC. After creating the project, I used Nuget to import the MS.EntityFramwork packages I need and the went to add a new item to select ADO.Net from my DB for my Entity Framework. However, as you can see from the screenshot below the packages are there but ADO.Net is not.
Although I cannot find ADO.Net I can select Scaffolding if I want to and something tells me that is the only option available to me. I've used this process of adding Entity Framework many times and I think it's no coincidence that it isn't available after updating my Visual Studio. Can someone please confirm this is my only option to work with my SQL database or is there something I'm missing in order to access ADO.Net.
ADO.Net only works with .Net Framework. You can pay attention to see what your framework version is. If it is .Net XXX, it should be that you have created the wrong project, and the type of project you should create is ASP.Net Web Application (.Net Framework).
If following the methods above doesn't work, please speak up.
I#m having the same problem as in issue: Use Entity Framework in .net 4.0 with Oracle database - possible?
The question was not answered in my opinion. So I would like to know if there is a possibility of using EF6 with Oracle.ManagedDataAccess.EntityFramework for a .NET4.0 project.
I am attempting to write a Data Access library for our suite of applications that use Oracle in .net. We currently use NHibernate and are thinking of migrating away as it appears to not be supported all that well.
I am working with Visual Studio 2013 and we have already constructed our Oracle Database. We don't have writes to update it (that is the domain of the db guys). So that will not be part of any calculation on our end.
The client on the server is 32 bit, so we are going to stick with that for now. It is already GAC'd in there, and no need to change it. So we have the 32 bit client on our development boxes.
I have EntityFramework 6.1.0 installed into my project via nuget. I have ODAC 1.112.3.20 installed in my project. The 32bit version of the application. I also have the ODP.net.x86 driver installed (also via nuget).
The problem is that everytime I attempt to create an ADO.net Database connection, the oracle provider is never an option? What am I missing? What do I need to get this to work?
I read an oracle forum one time that said I need to set my Entity Framework to 5.0 and not 6.0. Which is fine, but how do I do that?
EF 6 support is now provided by ODAC 12c Release 3 Beta:
From the .Net Developer newsletter (emphasis mine):
New Download: ODAC 12c Release 3 Beta The new ODAC beta includes
Entity Framework 6, Code First, Code First Migrations, .NET Framework
4.5.2 certification, managed ODP.NET XML DB, and managed ODP.NET distributed transaction support without Oracle.ManagedDataAccessDTC.dll.
I know this is getting a little old, but this is to answer the last part of your question (how to install EFv5). (Instructions written for VisualStudio 2013) with your solution open, click TOOLS->NuGet Package Manager->Package Manager Console. Enter the following:
Install-Package EntityFramework -Version 5.0.0
Edit
It’s been a while since I set up my machine, but I think this is what I had to do, hopefully it helps.
Setup:
Install Oracle Instant Client (or whatever you do for an Oracle Home)
Install ODTwithODAC121012 (if you Google that, it should come up)
Make sure your tnsnames.ora is in the right place for your Oracle Home
Setting up a new Visual Studio Solution:
New Solution (for me, of type ASP.NET Web Application)
Run command as in original answer
Add new project of type Class Library (for Model/Entities)
In new project, add new Item of type ADO.NET Entity Data Model
In Entity Data Model Wizard:
EF Designer from database (if you are using an existing database)
New Connection
In Data Source, there is (hopefully) an Oracle Database option
And below that, in data provider, I chose the ODP.NET Managed Driver
Enter user/pass, select Data Source and name connection
Edit 2
Oh, I forgot one thing, not sure if it's important. You may need to add a reference in that Model project to the oracle driver. Right click project -> Add -> Reference -> Assemblies -> Search for 'oracle', hopefully there is an entry for Oracle.ManagedDataAccess (my version was 4.121.1.0)
A few rants:
I don't think the process should be quite so difficult
I don't know why it takes them so long to update either. http://www.devart.com/ seems to do just fine staying on top of new Oracle/Visual Studio changes (they charge, but so does Oracle)
The conspiracy part of my brain says that Oracle has no interest in making it easier for you to not use their products and so they put no effort into it
Their default number mappings can really screw you up. For example, if your Oracle DB has fields of type NUMBER(10), it will map it as a 32-bit int, when not all 10 digit numbers fit :(
For more info on that mapping thing (the link shows how to override that 32-bit problem), see:
http://docs.oracle.com/cd/E56485_01/win.121/e55744/InstallConfig.htm#ODPNT8167
EF 6 is not yet supported by ODP.NET. See the release notes (README) for more info. EF6 will be supported shortly.
Edit: EF6 is now supported.
Sorry, I missed part of your question.
If you are using Visual Studio 2013, you must download Oracle Developer Tools for Visual Studio version 12.1.0.1.2 or later. With any older version, it will not be able to integrate with VS 2013.
Here is the download location:
http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
EF 6.0 is not supported yet but you can use EF5 providers in VS 2013. So my other answer is not really relevant.
Entity Framework 6 Code First
ODAC 12c R3 is the first ODP.NET release to certify with Entity
Framework (EF) 6 and EF Code First. EF Code First is a popular
development model for .NET object-relational mapping. Developers
define the application domain model using source code, rather than
with a designer or an XML-based configuration file. An EF Code First
model's classes are defined in code through Plain Old CLR Objects
(POCOs).
...
These features are all available in both managed and unmanaged
ODP.NET.
http://cshay.blogspot.com/2014/09/odac-12c-release-3-beta-now-available.html
is the Entity framework 6.0 compatible with oracle 11 ?
Will there be support for Entity Framework 6 in managed ODP.NET ?
Any reliable provider in the market for Entity framework 6.0,Oracle 11 support ?
As of today dotConnect for Oracle from Devart should work as far as I investigated (here). I don't think the guys from Oracle has reached so far to make ODP.NET compatible to EF6.
Actually I am also working on a project and I am curious about the results.
Is it worth spending time in these frameworks. Or they just another framework like microsoft developed in the form of MFC library.
I dont want to waste precious time, so please help. Under what scenarios these frameworks will be helpful.
EF and L2S are Object-Relational Mappers (ORM). They would be used wherever an ORM is used. StackOverflow uses Linq to SQL as its ORM layer, to good effect. Entity Framework is up-and-coming, and although it currently has issues, it will be greatly improved in the upcoming version 4.0.
Your time would be well spent learning one or both of these frameworks, as it will be highly likely you will use an ORM in your applications at some point.
It really depends on what your alternative is. If your alternative is using ADO.NET and DataSets, then yes, LinqToSql and EntityFramework are likely a step forward. If your alternative is NHibernate or another feature rich ORM, then they may be a step backward.
Microsoft has really strongly moved away from LinqToSql while still continuing to offer support for it and making minor changes. Microsoft is recommending all LinqToSql users move to Entity Framework. However, the Entity Framework that came out with VS 2008 SP1 / .NET 3.5 SP1 was in many ways a step back from LinqToSql. The Entity Framework that is coming out in April with VS 2010 and .NET 4.0 should be mostly an upgrade from LinqToSql, assuming you can migrate to VS 2010 / .NET 4.0 sometime in the near future.
YES! It is worth Learning. No! its not just another framework. It is useful for any application that uses a SQL Database to query data and present/do some logic.
Linq2Sql was introduced with .NET 3.5. Very useful if you dont have your own set of domain entities. A bit difficult to map Linq2Sql classes to our own domain entity classes in complexed scenarios.
But, recommend to use Entity Framework. EF was introduced with .NET 3.5 SP1. Much improved version of Linq2Sql and came as part of Olso Mixed Models. This can be used as a real ORM to map our own set of domain entities and the designer provides most of the features.
There is a new version of EF (EF4) ships with .NET 4.0.
Watch Evolving ADO.NET Entity Framework in .NET 4 and Beyond for what you can do with EF4.
Download the "Layered Architecture Sample for .NET" from Codeplex.com