Contents tagged with Entity Framework
In my earlier post, Getting started with Model First development using EF, I have shown you to create a database from the model class and how to persist the data to the database. In the second part of the series, I am going to show how the changes made to the underlying database can be reflected in the model class.
So let’s try to add a column to our user table.
ALTER TABLE MT_USER ADD Gender Varchar(5)
What is Model First ?
In Model First approach you will create a model of your domain entity using the EF designer and then generate database schema based on it. It stores the meta data in a EDMX file and model classes that interact with our business objects are automatically created from this EDMX file.
Let’s create a small console application for demonstrating this approach and name the project as EFModelFirst.
I am using VS 2012 and with EF 5.0.0 which can be downloaded from nugget using the command in your package manager console as shown below.