Pages

Thursday, September 28, 2017

Get the visual view of the model in Entity Framework Code First

Introduction

In this post we will discuss how to generate visual view from the models in Entity Framework Code First.

I’m using Visual Studio  2017 as the tool and Entity Framework version 6.

Solution Structure

I have two projects in the solutions.

  1. BlogSample.BO
    In this project we will have all the Business Objects.
  2. BlogSample.DAL
    This is  the data access layer and we have installed Entity Framework 6 and created DbContex and the Dataset. Also the BlogSample.BO project has been referenced as well.

Step 1

Install Entity Framework 6 Power Tools Community Edition

In Visual Studio go to Tools –> Extensions and Updates.

Search for Entity Framework 6 Power Tools and install the extension.

See the image below. I have already installed.

Entity Framework 6 Power Tools Community Edition - Suhail.Cloud


Step 2

Make DAL project as Startup project. Right click on the Context.cs file and go to Entity Framework –> View Entity Data Model.

Entity Framework 6 Power Tools Community Edition - Suhail.Cloud2

Your .edmx visual diagram will be generated as below. 

Entity Framework 6 Power Tools Community Edition - Suhail.Cloud


Solution

The solution is available in the below url.

https://drive.google.com/file/d/0ByEnOE8DAdvhYXhCTU5nVEdBR3M/view?usp=sharing

No comments:

Post a Comment