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.

Code First adding to collections? How to use Code First with repositories?

EDIT: This happen only on larger scale projects with repositories. Is there anybody using EF4 with CodeFirst approach and using …

entity-framework asp.net-mvc-2 entity-framework-4 code-first
how to annotate a parent-child relationship with Code-First

When using the CTP 5 of Entity Framework code-first library (as announced here) I'm trying to create a class that maps …

entity-framework code-first
Entity Framework Code-First Execute Scalar-Valued Functions

How can I execute a scalar function using code first? Below is what I have tried but only the query …

c# entity-framework code-first
Database in use error with Entity Framework 4 Code First

I have an MVC3 and EF 4 Code First application, which is configured to change the DB when the model changes, …

sql entity-framework code-first ef-code-first
How do i delete single record from table using EF 6.1.1

I am using Entity Framework 6.1.1. I am deleting single record from table as following but i am not sure whether …

entity-framework ef-code-first code-first
Code First vs. Database First

I created an Entity Framework model based on an existing database, then generated the POCO entities from the model. The …

c# entity-framework entity-framework-4.1 code-first database-first
Code First Migrations and Stored Procedures

I have just created a database and done my first migration (just a simple table add). Now I want to …

sql-server asp.net-mvc entity-framework code-first
EF Code First Readonly column

I am using EF Code first with database first approach. "with Database.SetInitializer(null);" My table has two columns createddate …

entity-framework entity-framework-4.1 code-first
How do I remove underscore of foreign key fields in code first by convention

I've got multiple classes (including TPT) in my project. Each POCO has a BaseClass, which has a GUID (called GlobalKey) …

entity-framework naming-conventions code-first entity-framework-6