Pages

Showing posts with label DB First Approch / Database First Approch / Create Database First then model then code. Show all posts
Showing posts with label DB First Approch / Database First Approch / Create Database First then model then code. Show all posts

May 20, 2011

Alim Ul Karim's Blog: Database First Approach / DB First Approach / MVC3

Alim Ul Karim's Blog: How to Create Database First in ASP.NET MVC3/MVC 3...: "If you are new in ASP . NET MVC / MVC3 or in EntityFramework ( EF ) you should look for some articles before read this topic. If you ar..."

May 19, 2011

Alim Ul Karim's Blog: How to Create Database First in ASP.NET MVC3/MVC 3...

Alim Ul Karim's Blog: How to Create Database First in ASP.NET MVC3/MVC 3...: "If you are new in ASP . NET MVC / MVC3 or in EntityFramework ( EF ) you should look for some articles before read this topic. If you ar..."

How to Create Database First in ASP.NET MVC3/MVC 3 using Entity Framework (EntityFramework - EF 4.1/EF4.1) 4.1

If you are new in ASP.NET MVC /MVC3 or in EntityFramework (EF) you should look for some articles before read this topic. If you are a beginner or apprentice then , I suggest you to watch Scott Hanselman's MVC-101 video , it will help you to learn about new ASP.NETMVC3 from beginner to advanced (if MVC2 is already known to you ,  MVC3 will not be a new path or unknown to you , basic structure remain same as MVC2).


The reason behind I am writing this topic because I haven't found any good resource to start my project as Database First in MVC using Entity Framework 4.1 (EF 4.1). In Entity Framework 4.1 coders,database designers, model designers can do what they want first, if you like to code then code first (there are lots of examples over the internet  about - code first in EF 4.1 few of them are linked in my article), if like to create model first then do it first and so on.
In this topic, I will write less and help you via images because  it's a fast and easy way to learn. So let's begin to work.


I have created a new ASP.NET 4 MVC3 HTML5 based Internet application, attached a database first as shown in the image , I recommend you to download the source and investigate yourself.
Project First Appearence - Database DB First Approach ASP.NET 4 MVC3
BlogContent DataTable Data
Taxonomy Data
ContentType Table Data
Existing Database , table relationships schema - Database DB First approach


Creating ADO.NET ENTITY Data Model From a Existing Database - Database First Approch


Generate Entity Data Model From Existing Database - DB - Database DB First approach 

Creating ConnectionString from Exiting Database - Database First approach


Entity Data Model Edmx file view


 right click on the white surface in the entity data model of Blog Database.

DBContext Generate From Entity Data Model

Creating Repository , Model and Database Table Class from the Entity Data Model, Click on 'ok' twice
Now Build your project and then do as below.
After Creating Repository, Model and DBContext from Wizard


Controller Wizard to Create V-View, C- Controller
V-View and C- Controller has been created with Read,Write, Delete, Details View ability

Created a Link for the Blog Content Controller

Preview of the Project

Code : http://www.mediafire.com/download/4oai056o5h3enlr/WebApplication3.7z


Download the Source File:
  1. Direct Link: Blog OpenSource Project - Database First Approch - ASP.NET MVC3 HTML5 Project
  2. Mediafire Link: Blog OpenSource Project - Database First Approch - ASP.NET MVC3 HTML5 Project
Related Videos of Scott Hanselman, Steve Sanderson , download High WMV for best quality experience:
  1. Scaffolding – ASP.NET, NuGet, Entity Framework Code First and More
  2. DevDays Keynote + MVC-101 + Nuget : Depth
  3. NuGet In Depth: Empowering Open Source on the .NET Platform

Author Related Links:
SEO Labels:

DB First Approch / Database First Approch / Create Database First then model then code / First effort Database - DB ASP.NET MVC 3/ MVC3 / EntityFramework Database First / EF 4.1 / EF4.1 Database First approch / EF 4.1 Database(DB) First Approch .