I am wondering the best way about setting up asp.net membership in sql server to work well with linq to sql.
I’d like to use the username field for the foreign key relationships and have linq to sql recognise the asp user property.
I am having some problems getting relationships right between the users table and my other tables. Do I need to set username to a primary key for this to work?
When I did it, I just let the
UserIdfield in the aspnet_Users table be the foreign key. When you use LinqToSql you can still filter based on the UserName in asp like this:This is because of the foreign key relationship between the aspnet_Users table and your own table.