Does anybody have an example of how to properly reference a user in an ASP.NET membership table (users) in an entity using Entity Framework CodeFirst? I want the resulting table from CodeFirst to reference the existing ASP.NET membership tables. I can elaborate more if required.
2 Answers
I'm not sure I'm answering your question. But I use the "UserId" field of the "aspnet_Users" table in ForeignKey constraints to reference users.
I recently built a membership provider specifically for code-first development, I based it on the Altairis code-first example but mine has the ability to sit neatly in a separate library away from project code if the need arises.
Check it out at: http://cfmembershipprovider.codeplex.com