asp.net entity framework tutorial part- 10

Опубликовано: 13 Февраль 2026
на канале: tutorialaspnet
5,665
2

http://www.jquell.com/ In the previous tutorial you created an n-tier web application using the Entity Framework and the ObjectDataSource control. This tutorial shows how to add business logic while keeping the business-logic layer (BLL) and the data-access layer (DAL) separate, and it shows how to create automated unit tests for the BLL.
In this tutorial you'll complete the following tasks:
Create a repository interface that declares the data-access methods you need.
Implement the repository interface in the repository class.
Create a business-logic class that calls the repository class to perform data-access functions.
Connect the ObjectDataSource control to the business-logic class instead of to the repository class.
Create a unit-test project and a repository class that uses in-memory collections for its data store.
Create a unit test for business logic that you want to add to the business-logic class, then run the test and see it fail.
Implement the business logic in the business-logic class, then re-run the unit test and see it pass.