The beauty of the provider model is that you can swap providers through configuration without any
changes to your programming code. If you have your own custom data store, you could write your own
provider and plug it into your website to replace one of the default providers with very little effort.
Each provider needs a data store — represented by the bottom part of the diagram in Figure
16-1 — and is written to work with one or more specific data stores. For example, the
DefaultMembershipProvider (to handle membership services such as creating users, logging in,
and resetting passwords) and the DefaultRoleProvider (to handle role-related tasks) are designed
to work with any version of Microsoft SQL Server, including Express, LocalDB, SQL Server
Compact, and SQL Azure. These two providers replace the SqlMembershipProvider and the
SqlRoleProvider that shipped with earlier versions of ASP.NET.
In the remainder of this chapter, you see how to use the DefaultMembershipProvider and the
DefaultRoleProvider. In the next chapter, you work with the DefaultProfileProvider. You can
configure all three providers to use the same SQL Server database, making it easy to centralize all
your user data.
Ideally, you don’t deal with these providers directly. Under normal circumstances, the various providers
are configured for your website at a central location. You then use these providers by talking to
the application services. Although you could access these services directly from code, you often use
the ASP.NET built-in login controls to do the hard work for you. These controls are discussed next.