How to use Membership provider with EF Code First?

后端 未结 6 1805
独厮守ぢ
独厮守ぢ 2020-12-30 01:33

I have models based on EF Code First and I want to use them with the default MembershipProvider, but I don\'t know how to write the model correctly, so it won\'t erase all m

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 01:59

    Have a look at this project

    http://codefirstmembership.codeplex.com/

    It has entity classes for users and roles, as well as a roleprovider and membershipprovider implementation. If you include the users and roles in your datacontext class the tables will be created in your database.

提交回复
热议问题