实体框架Codefirst和ASP。网会员

时间:2021-07-13 06:55:59

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.

有人知道如何在ASP中正确引用用户吗?在实体中使用实体框架CodeFirst的成员表(用户)?我希望CodeFirst生成的表引用现有的ASP。网会员表。如果需要的话,我可以详细说明。

2 个解决方案

#1


2  

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.

我不确定我是否回答了你的问题。但我使用了“aspnet_Users”表中的“UserId”字段,以引用用户。

#2


1  

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.

我最近专门为代码优先开发构建了一个成员提供程序,我基于Altairis代码优先示例,但是如果需要的话,我的代码可以在一个独立的库中,与项目代码分开。

Check it out at: http://cfmembershipprovider.codeplex.com

查看:http://cfmembershipprovider.codeplex.com

#1


2  

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.

我不确定我是否回答了你的问题。但我使用了“aspnet_Users”表中的“UserId”字段,以引用用户。

#2


1  

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.

我最近专门为代码优先开发构建了一个成员提供程序,我基于Altairis代码优先示例,但是如果需要的话,我的代码可以在一个独立的库中,与项目代码分开。

Check it out at: http://cfmembershipprovider.codeplex.com

查看:http://cfmembershipprovider.codeplex.com