This is a migrated thread and some comments may be shown as answers.

MembershipUser inside partial class

1 Answer 42 Views
Integration with other products
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pawel
Top achievements
Rank 1
Pawel asked on 05 Sep 2011, 06:12 PM
Hey, is there possibility to create MembershipUser class inside partial class of model ?
public partial class User
    {
        [Transient]
        public MembershipUser _user = Membership.GetUser();
 
        public User()
        {
        }
           public Guid GetGUID()
        {            
            return (Guid)_user.ProviderUserKey;
        }
    }
Because I got at bold line this error

"Object reference not set to an instance of an object."

1 Answer, 1 is accepted

Sort by
0
Pawel
Top achievements
Rank 1
answered on 05 Sep 2011, 08:53 PM
Ok problem solve, I just forget that my session was end...and I wasn't on my account.
Tags
Integration with other products
Asked by
Pawel
Top achievements
Rank 1
Answers by
Pawel
Top achievements
Rank 1
Share this question
or