Top "Code-first" questions

Code-first is a software implementation approach that favors programming against an API over other approaches that may rely more heavily on visual tools or require the presence of some external source that is inspected to generate program behavior, structure, or data.

EF Code First - Globally set varchar mapping over nvarchar

I have what should be an easy question but I have been unable to find the answer myself. I am …

c# entity-framework-4 code-first ef-code-first
Entity Framework Code First Many to Many Setup For Existing Tables

I have the following tables Essence, EssenseSet, and Essense2EssenceSet Essense2EssenceSet is the linking table that creates the M:…

entity-framework mapping many-to-many entity-framework-4.1 code-first
Can I access the discriminator value in TPH mapping with Entity Framework 4 CTP5

Using Entity Framework 4 CTP5 Code First and this example Is it possible to access the discriminator value? I would like …

entity-framework-4 code-first entity-framework-ctp5
EntityFramework CodeFirst: CASCADE DELETE for same table many-to-many relationship

I have an entry removal problem with the EntityFramework and a many-to-many relationship for the same entity. Consider this simple …

c# entity-framework ef-code-first entity-framework-6 code-first
EF6, Code-First, enable-migrations, "Unable to load the specified metadata resource"

I have created a C# class library with 3 entity classes and a DbContext for code-first generation of database. All has …

entity-framework code-first entity-framework-migrations entity-framework-6
EF Code First Migration with Multiple Database / DbContext

I have two database each with their own dbcontext. I've setup two migration configurations. I can add a migration for …

entity-framework code-first entity-framework-migrations multiple-databases
Best Practices for Lookup Tables in EF Code-First

I'm doing my first project with EF and I'm planning to go the code-first model. I'm trying to find a …

c# entity-framework-4.1 poco code-first
Code first migrations - what connection string will it use?

Code first migrations have been working very well for me. I have a services project and a wpf project. The …

entity-framework connection-string code-first entity-framework-migrations ef-model-first
EF Code First: Multiplicity constraint violation

HELP! - I am receiving the following error on my navigational model ArticleType: A relationship multiplicity constraint violation occurred Here …

c# entity-framework code-first fluent-interface
Can't run code first migrations using migrate.exe

I'm trying to update a database on a test system. When I run update-database in visual studio things work as …

c# entity-framework code-first