Top "Ef-code-first" questions

EF Code-First is a way of using Microsoft's Entity Framework with POCO classes, as opposed to model-first or DB-first.

Possible to default DateTime field to GETDATE() with Entity Framework Migrations?

I added EntityFramework.Migrations (Beta 1) to an existing Code-First app that is going through some changes (for both migration capabilities …

entity-framework-4 ef-code-first entity-framework-migrations
Non-static method requires a target. Entity Framework 5 Code First

I am getting the error "Non-static method requires a target." when I run the following query: var allPartners = DbContext.User .…

ef-code-first .net-4.5 entity-framework-5
Exclude a field/property from the database with Entity Framework 4 & Code-First

I will like to know that is there a way to exclude some fields from the database? For eg: public …

c# .net entity-framework-4 ef-code-first poco
Mapping many to many relationship in entity framework code first

I'm try make a test in EF, creating a many to many relationship, because I always mapping One to One …

c# entity-framework ef-code-first many-to-many
Entity Framework Code First naming conventions - back to plural table names?

I am just taking a crack at entity framework code first. Following their naming convention, we now have to name …

c# entity-framework entity-framework-4 ef-code-first naming-conventions
Linq To Entities - Any VS First VS Exists

I am using Entity Framework and I need to check if a product with name = "xyz" exists ... I think I …

entity-framework ef-code-first exists any
EntityFramework code-first custom connection string and migrations

When I create a context with a default connection string (as read from the app.config) the database is created …

entity-framework ef-code-first connection-string entity-framework-migrations
How to declare one to one relationship using Entity Framework 4 Code First (POCO)

How to declare a one to one relationship using Entity Framework 4 Code First (POCO)? I found this question (one-to-one relationships …

c# entity-framework ef-code-first poco one-to-one
Create a DbSet<T> dynamically in Entity Framework?

In LINQ to SQL, I can create a repository dynamically using DataContext.GetTable<T>. Is there a similar …

c# linq-to-sql entity-framework-4 ef-code-first dbset
Problems creating a Foreign-Key relationship on Entity Framework

i'm having trouble configuring a foreign key relationship in my Entity Framework fluent Api: Here is the head of the …

c# .net entity-framework ef-code-first foreign-keys