Take the 2-minute tour ×

Can someone help me answer these questions on EntityFramework?

  1. Does it do anything special to the database? (like extra tables)
  2. Can I add data directly with SQL without breaking EF?
  3. Can I add tables and fields without breaking EF?
share|improve this question
Entity Framework is not a database - it's a database access technology.... –  marc_s Nov 20 '11 at 20:47
add comment

2 Answers

up vote 1 down vote accepted

Yes you can access database with plain SQL when using EF.

  1. No. EF just uses database. There is one exception in code first approach where EF can create one additional table for its own purpose called EdmMetadata.
  2. Yes you can add data directly with SQL. If both your entity model and database are defined correctly it will not break EF.
  3. Yes you can add new tables directly but EF will not know about them. You should not change existing tables because it can break EF.
share|improve this answer
Thank you very much –  Trevor Nov 21 '11 at 13:37
add comment

You can do it with:

var context = new YourObjectContext();
var s = context.ExecuteStoreCommand("some query");

if your query create a table, this only create a table on db and not effected on EF

share|improve this answer
I know about ExecuteStoreCommand, but your answer does not really address my question. –  Trevor Nov 20 '11 at 21:00
Illustrate your question with extra description to answer and question near to them. –  Reza ArabQaeni Nov 20 '11 at 21:09
add comment

Your Answer


