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.

Create code first, many to many, with additional fields in association table

I have this scenario: public class Member { public int MemberID { get; set; } public string FirstName { get; set; } public string LastName { …

c# entity-framework ef-code-first many-to-many
Entity Framework: One Database, Multiple DbContexts. Is this a bad idea?

My impression to date has been that a DbContext is meant to represent your database, and thus, if your application …

entity-framework ef-code-first entity-framework-4.3 dbcontext
StringLength vs MaxLength attributes ASP.NET MVC with Entity Framework EF Code First

What is the difference in behavior of [MaxLength] and [StringLength] attributes? As far as I can tell (with the exception …

asp.net-mvc-3 ef-code-first entity-framework-4.1
EF Code First "Invalid column name 'Discriminator'" but no inheritance

I have a table in my database called SEntries (see below the CREATE TABLE statement). It has a primary key, …

entity-framework ef-code-first
EntityType 'IdentityUserLogin' has no key defined. Define the key for this EntityType

I am working with Entity Framework Code First and MVC 5. When I created my application with Individual User Accounts Authentication …

ef-code-first asp.net-mvc-5 seeding
How to delete and recreate from scratch an existing EF Code First database

I am using EF Code First with EF 5 in VS 2012. I use PM update-database command and I have a simple …

ef-code-first entity-framework-migrations
Entity Framework (EF) Code First Cascade Delete for One-to-Zero-or-One relationship

Following the "Code First Modeling" section of the Pluralsight "Getting Started with Entity Framework 5" course by Julie Lerman, I created …

c# entity-framework ef-code-first entity-framework-5 cascading-deletes
Entity framework code-first null foreign key

I have a User < Country model. A user belongs to a country, but may not belong to any (null …

entity-framework mapping ef-code-first foreign-key-relationship entity-framework-4.1
How do I detach objects in Entity Framework Code First?

There is no Detach(object entity) on the DbContext. Do I have the ability to detach objects on EF code …

entity-framework entity-framework-4.1 ef-code-first
What effect(s) can the virtual keyword have in Entity Framework 4.1 POCO Code First?

Does the virtual keyword has an effect when used on the properties in EF Code First?. Can someone describe all …

entity-framework-4 ef-code-first entity-framework-4.1