Contents tagged with Entity Framework

  • Model First Development Using EF 5.0 – Updating the Model

    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)

     

  • Getting Strated with Model First Development using Entity Framework.

    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.

     

    clip_image002

     

    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.

     

    clip_image004