TAILIEUCHUNG - ASP.NET MVC Tutorial 10 CS

In this tutorial, you learn how to build model classes and perform database access by taking advantage of Microsoft LINQ to SQL In this tutorial, we build a basic Movie database application. We start by creating the Movie database application in the fastest and easiest way possible. We perform all of our data access directly from our controller actions. Next, you learn how to use the Repository pattern. Using the Repository pattern requires a little more work. However, the advantage of adopting this pattern is that it enables you to build applications that are adaptable to change and can. | MVC Creating Model Classes with LINQ to SQL The goal of this tutorial is to explain one method of creating model classes for an MVC application. In this tutorial you learn how to build model classes and perform database access by taking advantage of Microsoft LINQ to SQL In this tutorial we build a basic Movie database application. We start by creating the Movie database application in the fastest and easiest way possible. We perform all of our data access directly from our controller actions. Next you learn how to use the Repository pattern. Using the Repository pattern requires a little more work. However the advantage of adopting this pattern is that it enables you to build applications that are adaptable to change and can be easily tested. What is a Model Class An MVC model contains all of the application logic that is not contained in an MVC view or MVC controller. In particular an MVC model contains all of your application business and data access logic. You can use a variety of different technologies to implement your data access logic. For example you can build your data access classes using the Microsoft Entity Framework NHibernate Subsonic or classes. In this tutorial I use LINQ to SQL to query and update the database. LINQ to SQL provides you with a very easy method of interacting with a Microsoft SQL Server database. However it is important to understand that the MVC framework is not tied to LINQ to SQL in any way. MVC is compatible with any data access technology. Create a Movie Database In this tutorial -- in order to illustrate how you can build model classes -- we build a simple Movie database application. The first step is to create a new database. Right-click the App_Data folder in the Solution Explorer window and select the menu option Add New Item. Select the SQL Server Database template give it the name and click the Add button see Figure 1 . Figure 1 - Adding a new SQL Server Database After you .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.