0

I am new to the Entity Framework, and have just gotten through Lerman’s EF book. Unfortunately, it only covers EF v4. I am looking at the Fluent API in EF v6, and it seems much better and easier to use.

Unfortunately, Fluent API in EF v6 seems to be using SqlClient instead of EntityClient – at least from the connection string (provider name). Why is that? Does this mean we would not be able to use it with Oracle or any other non-MS DB?

6
  • Can you provide where you saw that it is using SqlClient? Commented Mar 13, 2014 at 14:08
  • See Code First to an Existing Database under section Configuration file. Unfortunately, the other tutorials do not show the connection strings. Commented Mar 13, 2014 at 14:14
  • 1
    When you are following the tutorial, just select Oracle instead of Microsoft Sql Server everything else would be the same. Commented Mar 13, 2014 at 14:17
  • So does the Fluent API ever use the Entity Client? That was part of my question. You did answer the first part though. Commented Mar 13, 2014 at 14:22
  • 1
    The FluentAPI uses neither, it works on a higher level on DbModelBuilder's and EntityTypeConfiguration<T> objects. Commented Mar 13, 2014 at 14:23

2 Answers 2

1

EntityClient in EF4 (and in fact in EF5 and EF6) is a way of boxing database related concepts and EF related concepts. Database related concepts is how EF is talking to the database while EF related concepts is how the model looks like. In EF4 the model primary means for serializing the model was the edmx file which contained CSDL, MSL and SSDL artifacts. If you look at the entity connection string it consists of paths to the artifacts (i.e. CSDL, MSL, and SSDL) which are EF related concepts and a provider connection string which is the database part. In fact for Model and Database First even EF6 still works the same way. For Code First approach your code (along with the configuration in the OnModelCreating and custom conventions) is your model. As a result there is no need to serialize and store your model because it is part of your app. Therefore the EF related concepts could be dropped and after doing so, only database related concepts remained which were already captured in the ADO.NET provider model.

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

Comments

0

I don't know where you saw what you saw but you can use any provider as long as the provider did the extra work to make their ADO.NET provider compatible with Entity Framework.

Oracle's ADO.NET provider is compatible with Entity Framework.

2 Comments

This does not seem to be using the EF v6 Fluent API. The previous versions were different as far as I understand.
The Fluent API is just a different way of describing the classes, for the connection string just use the standard ADO.NET connection strings

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.