문제

How can I add a User class as a property to a class I've created?

I'm using the membership classes in my project. First time I've done so. I have a class called Site and I'd like to be able to add a user class as a property to that site.

Ultimately what I'm trying to get to is this point:

Dim dudeThatCreatedSite As String = Site.User.Identity.Name

I'm struggling a little with getting my head around how Membership, MembershipUser and User all work together and I don't see how I can as User as a property.

도움이 되었습니까?

해결책

Use MembershipUser:

Private myUserValue As MembershipUser
Public Property MyUser() As MembershipUser
    Get
        Return myUserValue
    End Get
    Set(ByVal value As MembershipUser)
        myUserValue = value
    End Set

End Property
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top