It has always been a problem when it comes to understand provider in .Net and most of the people miss conceptualized it specially beginners, same was the case with me. So I decide to a post on it. I am writing this post for beginner and intermediate level audience.
What is provider in .Net implementation?
At grass root level provider is a dll (class library) which contains the some specific implementation. For instance:
ActiveDirectoryMembershipProvider this provider is used for authenticating user from active directory in domain environment. We refer to this provider by using its fully qualified name.
SqlMembershipProvider this provider is used for user authentication from the database created by aspnet_regsql.exe command. We refer to this provider by using its fully qualified name.
This dll knows the schema of the database created by aspnet_regsql.exe command. It also contains methods to authenticate user, create user, edit user, delete user etc.
When using these providers we don’t need to worry about writing code because Microsoft has already done that job for us. All we need to do is:
1. Specify the provider and it configuration in web.config.
2. Specify the provider in the ASP.Net login controls so that they can utilize this provider.
You can even write your own provider let’s say you want to authenticate users from Linux domain, so u can write your own provider which has the implementation for authenticating user from Linux domain.
There are several other providers shipped with .Net framework and all of them server different purpose.
Site map -- System.Web.XmlSiteMapProvider
Profile -- System.Web.Profile.SqlProfileProvider
Session state -- System.Web.SessionState.InProcSessionStateStore
So the rule of thumb is provider is nothing but a dll which server what it is written for. Hope this post help you people, have a nice day :).