I am attempting to design a custom profile class that allows me to access the aspnet tables in addition to my custom tables (all in the same DB).
I have been following two online examples that describe how to wire up a custom profile class. In this example, I am asked to inherit from ProfileProvider
How To Implement A Custom Profile Provider
And, in this one, I am asked to inherit from ProfileBase:
Writing a custom ASP.NET Profile Class
What is the difference between these two examples and which way is better? Should I be inheriting from ProfileProvider or ProfileBase? What is the difference?
public class UserProfile : ProfileProvider
public class UserProfile : ProfileBase
Thanks.
The
ProfileProviderbase class is the provider that creates the object that derives fromProfileBase.When you specify a custom provider (that is, a type that derives from
ProfileProvider), you’re writing a class that creates profile objects for a given user. For example, maybe you read the profile data (favorite color, age, location, etc.) from a database, a file on disk, or from a remote web service.This is useful is you need functionality that is not available in ASP.NET’s built in profile provider.
When you specify a custom profile base class (that is, a type that derives from
ProfileBase) you’re writing a class that represents the profile data itself.This is useful when you want to have additional functionality on the profile object itself, such as providing additional metadata on the profile properties.