1

My company has an older ASP site that looks like it's written using model-first EF pattern... Except there are no references to EntityFramework.dll anywhere. Talking to the original coder, it doesn't seem he actually knows how he got it to work. He though EF was in the System.Data.Entity namespace as it comes in the framework.

How is it that he was accessing a database (DB2) using models/entities but not actually referencing the EF anywhere ?

4
  • Are you using LINQ to SQL? Commented Jun 22, 2015 at 17:06
  • Can you post some code? Commented Jun 22, 2015 at 17:06
  • No Linq-to-Sql in here. The only things used other than the standard framework is the Enterprise Library. And maybe that has it in there... I've just never used it before. Commented Jun 22, 2015 at 17:25
  • I can't post the code... There's so much of it and I'm pretty sure they would have issue with that (IP and all). Commented Jun 22, 2015 at 17:26

2 Answers 2

1

As the documentation from MSDN for System.Data.Entity:

The System.Data.Entity namespace contains classes that provides access to the core functionality of the entity framework.

To access a database without Entity Framework, you can use . It is the first level of data access and you should learn it before using any ORM tool. Check the namespace System.Data.SqlClient to have types to access Sql Server database. If you check each type, you will see there is a common convention to implement a ado.net data access in .Net. WE have DbConnection, DbCommand, DbTransaciton, IDataReader, etc. All these common types you can see in System.Data.Common.

For the DB2 database, you can download the .Net Provider for data access with Db2 in this link because it is not native provider. It is the same way as you do for other database, but use the specific .Net Provider.

Sign up to request clarification or add additional context in comments.

Comments

1

Turns out that EF 4 was initially released as part of .NET 4.0. Only since EF 4.1 was it separated into its own package.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.