The provider model is introduced in ASP. NET 2.0 (in some cases, it is translated into a "Provider Model"). The provider model is a design mode and is not unique to ASP. NET 2.0. The so-called design pattern is an improvement of software design from practice to theory. As long as you master the principle, you canProgramImplement the Provider Model.
Provider Model removedCodeThe dependency on specific storage makes the application code loosely coupled with the specific data access logic. For example, when writing a sales system, we don't know which method the customer wants to store data in the future. In this case, if the provider model is introduced and the Access database is used for data storage during writing, we do not need to modify the entire system if the customer wants to use the SQL Server database at the time of release, you only need to add an SQL Server database provider to the system, and then configure this provider as the default provider to provide database persistence for the system. Even if you need to use the Oracle database in the future, you only need to create a new provider for Oracle and modify the configuration file.
Where ASP. NET 2.0 uses the provider mode:
1: sitemappath path navigation: Based on the site map and the address of the current page, automatically generate path-based navigation. The data source can be a sitemap file in XML format or a provider of a custom database.
2: Membership: provides users with a full set of functions related to user and administrator accounts (registration, login, password retrieval, and lock ). The data source can be an SQL Server database or an Active Directory of AD.
3: Role role : authorize a role to the user. The data source can be an SQL Server database or Windows-based group authorization.
4: Profile personalization : records users' website personalization settings. The data source can be an SQL Server database or a provider of a custom database.