java begineer
java begineer

Reputation: 1

MVC and Entity Framework

Can a Model First approach in MVC be implemented by avoiding the UML designer file? In my previous company Entity Model was written in a Xaml file. Then we used to run a T4 template tool and then get an Edmx file by choosing Generate views option. This would create class file and SQL scripts for procedures, Table Valued Functions which we later execute in SQL server to create database.

I am confused whether its code first or model first approach as we had not used any diagram to create entity relation.

Upvotes: 0

Views: 54

Answers (1)

Gert Arnold
Gert Arnold

Reputation: 109080

This is model first.

But IMO "model first" is a misnomer making it more confusing than it should. In fact, it's "mapping first". An object-relational mapper (ORM), like Entity Framework, always deals with three main components --database, object-oriented code and the mapping between these two. Any of these three parts can be created first.

The other flavors are "database first": first the database, then the mapping (edmx) then the code (running t4 templates) and "code first: first the code, then the mapping (conventions, data annotations, and/or fluent) then the database (migrations).

Upvotes: 1

Related Questions