views:

113

answers:

2

My table, AccLink, has a foreign key, UserId, to the aspnet_User table created by the Membership Provider.

When creating an object of type AccLink (I'm using the entity framework) I need to assign the aspnet_User by getting the current user object.

I tried Membership.GetUser(userName) but it said it couldn't be converted to type aspnet_User. What is equivalent to the model built by the entity framework that I can use to assign to the AccLink object?

A: 

I think the only way is to get an aspnet_User object from the database (e.g. select by user name or email or some unique info you get from MembershipUser)

chris166
A: 

How are users authenticating? If you're not using forms based authentication then System.Net.CredentialCache.DefaultCredentials would hold the current security context.

CptSkippy