You are developing an ASP.NET MVC application that uses forms authentication against a third-party database.
You need to authenticate the users.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Explanation:
ASP.NET membership is designed to enable you to easily use a number of different membership providers for your ASP.NET applications.
There are two primary reasons for creating a custom membership provider.
You need to store membership information in a data source that is not supported by the membership providers included with the .NET Framework, such as a FoxPro database, an Oracle database, or other data sources.
You need to manage membership information using a database schema that is different from the database schema used by the providers that ship with the .NET Framework.
To implement a membership provider, you create a class that inherits the MembershipProvider abstract class from the System.Web.Security namespace.
Incorrect Answers:
C: Class ProviderBase
The provider model is intended to encapsulate all or part of the functionality of multiple ASP.NET features, such as membership, profiles, and protected configuration.
References: https://msdn.microsoft.com/en-us/library/f1kyba5e.aspx
IMHO D is the best answer here.
ASI comparison:
https://docs.microsoft.com/en-us/dotnet/api/system.web.security.membershipprovider?view=netframework-4.7.2
vs
https://docs.microsoft.com/en-us/dotnet/api/system.configuration.provider.providerbase?view=netframework-4.7.2
Real usage: http://logcorner.com/how-to-configure-custom-membership-and-role-provider-using-asp-net-mvc4/, https://stackoverflow.com/questions/2771094/how-do-i-create-a-custom-membership-provider-for-asp-net-mvc-2
0
0
sorry for mistype, it should be: Classes comparison
0
0