Part 2: Data Access Layer By Joe Stagner | July 21,201 0 Translated By litdwg | March
Print
Tailspin Spyworks demonstrates how extraordinarily simple it is to create powerful, scalable applications for. NET platform. it shows off how to use the great new features in ASP. NET 4 to build an online store, including shopping, checkout, and administration.
Use Tailspin Spyworks to demonstrate how simple a well-structured application can be created on the. NET platform. Demonstrate how to use the new features of ASP. NET 4 to create an online shop that includes shopping, settlement, and management functions.
This tutorial series details all of the steps taken to build the Tailspin Spyworks sample application. Part 2 covers adding the data access layer.
This series of guides gives a detailed explanation of each step of the build case program. The second part describes how to add a data access layer.
Add data access layer
Our ecommerce application will depend on two databases.
This e-commerce program will need two databases.
For customer information we'll use the standard ASP. NET Membership database. For our shopping cart and product catalog we'll implement a SQL Express database as follows.
We will use standard ASP. NET Membership database. The shopping cart and product data will be saved by creating a new database.
Having created the database (Commerce. mdf) in the application "s App_Data folder we can proceed to create our Data Access Layer using the. NET Entity Framework.
After creating a database (Commerce. mdf) in the App_Data folder, we use. NET EntityFramework to create a data access layer. (Tip: You can also directly create this database in SQL Server Standard Edition ).
We'll create a folder named "Data_Access" and them right click on that folder and select "Add New Item ".
Create a folder named "Data_Access" and Right-click it and select "Add new project ".
In the "Installed Templates" item and then select "ADO. NET Entity Data Model" enter edm_performance.edmx as the name and click the "Add" button.
In the dialog box, select "ADO. NET Entity Data Model", name it edm_performance.edmx, and click "add.
Choose "Generate from Database ".
Select generate from database.
Save and build.
Save and generate.
Now we are ready to add our first feature-a product category menu.
Now we are ready to add the new feature-product directory.