简体   繁体   中英

Simple Membership: can I create a user without referencing webmatrix?

I have my restrictions to not to reference webmatrix here.

I want to create a user record in membership tables of simple membership (using EF 5). To make it easier, I have mapped EF Models to those tables.

Is it possible to with code without webmatrix ?


EDIT

I don't want to use any membership provider.

EDIT

The system uses simple membership. I don't want to change that. From a separate project, I want to add a user to that database without referencing WebMatrix. Is that possible ?

使用标准的ASP.NET成员资格,您可以使用System.Web.Security.Membership.CreateUser创建新用户。

No, you cannot use SimpleMembership without WebMatrix as SimpleMembership lives in the WebMatrix namespace.

You can, however, use any number of other membership providers, such as the original SqlMembershipProvider, the Universal Providers, or any number others that are available.

EDIT:

Yes, you can add a user to the database manually. In the comments below I have included a link to the source for SimpleMembershipProvider.cs, examine that code and use the same methods in your own project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM