Back to EF FAQs Table of Contents


Can I delete data that has not been queried from the database?

The Entity Framework does not provide a way to delete data in the database directly. You can pass commands directly to the database with the ExecuteStoreCommand method. You could use that to send a delete command. For other ways to perform this task, see Tip 9 Deleting an Object Without Retrieving It.

My database isn't being updated, but no errors occurred in my application.

This post discusses the possible reasons why this problem may occur.

How do I trace the commands that are executed against the data source?

You can use ObjectQuery's ToTraceString method. For more information, see this forum thread or this quesiton on stack overflow.
For tutorials that show how to view the SQL queries that EF generates, see Maximizing Performance with the Entity Framework in an ASP.NET Web Application (using ObjectContext) and Advanced Entity Framework Scenarios for an MVC Web Application (using DbContext).

You might also want to take a look at the Entity Framework tracing provider.

Is there TVF (table-valued function) support?

Not yet. The June 2011 CTP version of EF includes a preview of TVF support. More details of the design are discussed here. The current plan is to include TVF support in the next major version of the .NET framework after 4.0.

Is there a way to write LINQ or Entity SQL statements that would be translated into set-based CUD operations without bringing the affected entities into memory (SQL DML statements)?

The Entity Framework doesn't have that capability. We recommend that you use stored procedures or ExecuteStoreCommand to achieve executing CUD operations without bringing the entities into memory.

What is the recommended way to use full-text search (FTS) queries with the Entity Framework?

There is no built-in full-text search support. One way to achieve FTS is by using stored procedures. You can find some suggestions here.

Does the Entity Framework support spatial data types?

Support for spatial data types is being added to the release following Entity Framework 4.1.

Does the Entity Framework support UDTs?

Not currently. There are plans to add support in future releases.

Does Entity Framework 4 support DateTime functions like DayOfWeek?

No. You can use SqlFunctions.DatePart instead. For more information, see this forum thread.

Many datetime-related functions are available through the System.Data.Objects.EntityFunctions class.

Is the POCO template part of Visual Studio?

The template is not included with Visual Studio but can be downloaded from the Visual Studio Gallery.

Is code-first part of the Entity Framework 4?

Yes. Code-first support was added to the Entity Framework 4.1 release.

Does the current version of the Entity Framework have "magic columns" or mapping/metadata conventions based on column names?

The released versions of the Entity Framework (3.5 SP1 and 4) do not have magic columns. The code-first feature CTP currently has the convention that int columns that contain "Id" are treated as identity columns.

What are some MVC with Entity Framework resources/samples?

The following tutorials show you how to use ASP.NET MVC with the Entity Framework:

Back to EF FAQs Table of Contents