I have a question regarding classes Membershipand MembershipUserin the System.Web.Security namespace.
Both of these classes are present in separate libraries, how does someone know the details of use without looking at any documentation and just class methods, properties, etc.? If I came across a class MembershipUser, I would know that there is a property Emailthat I can get and set, but I would not know that there is a class Membershipthat has a method that returns user data as MembershipUserreturn type without any changes.
For example, to get the email address of users, we can create an object MembershipUserand use the method GetUser()provided by the class Membership, because it GetUser()has a return type Membership. Something like that.
MembershipUser user = Membership.GetUser();
string Email = user.Email;
MembershipUser Class:
public class MembershipUser
{
...
public virtual string Email { get; set; }
...
}
Membership Class:
public static class Membership
{
...
public static MembershipUser GetUser();
...
}
source
share