Creating ASP.NET MVC 5 Application using Entity Framework 6 and Identity with CRUD Operations on visual studio 2015 - Part-3

This is the part-3 of asp.net mvc 5 series. In this tutorial you will learn how to create your entity framework model as well as SQL server database connectivity with entity framework model.Also  learn how to create a multiple project in one solution. If you have any query please feel free and post a comment right below. Other part of series,

  1. Creating ASP.NET MVC 5 project Part-1?
  2. Creating SQL Server database Part-2?
  3. Creating Entity Framework project Part-3 ?
  4. Customize the default template of ASP.NET MVC 5 Part-4 ?
  5. How to add a controller and view Part-5 ?
  6. How to Add Model Part-6 ?
  7. How to make a patient registration form Part-7?
  • Creating your entity framework model

    • Let's create ASP.NET MVC 5 empty project in HIMS solution with name HIMS.Model. So right click on the HIMS solution and go to Add New Project.
    • In the add new project window  go to Installed> Visual C #> Web.  Select the ASP.NET Web Application and enter the name of project HIMS.Model and click OK. 
    • Pop-up window will be appear and select the empty template from the template window. Finally click OK.
    • Your empty project is created successfully. Here you can see there is a two projects in a single solution.
    • Now learn how to add entity model in the project? Let's add the entity model in HIMS.Model project by right clicking on the HIMS.Model project and go to Add > New item.
    • In the pop-up window go to Installed > Visual C# > Data > ADO.Net Entity Data  Model  and enter the name of entity model HIMS.Patient.Model then click Add.
    • Select the EF Designer from database  model from the Entity data model wizard window and click next.
    • Choose the Microsoft SQL Server data source  from data source window and click continue.
    • In connection properties window select the server name if not found then click on the refresh button.In connect to database panel select or enter the database name HIMS.DB and then click  OK.
    • Entity data model wizard window will be appear and you can see your connection string is created successfully and click next.
    • Choose the entity framework version from the pop-up window Entity Framework 6.x and click next.
    • From the pop-up window choose the database objects and settings which you want to include in your model.Finally click on the finish.
    • Congratulations! your entity model is created successfully.
    • Now you can see the whole project structure like this.
  • In the part-4 you will learn how to customize the default template of asp.net mvc 5.

No comments:

Post a Comment

Creating ASP.NET MVC 5 Application using Entity Framework 6 and Identity with CRUD Operations on visual studio 2015 Part-9

This is the part-9 of asp.net mvc 5 series using entity framework and identity from scratch.In this tutorial you will learn how to bind a...