c# - How to seed Register & Login data using Entity Framework & SimpleMembership -


using simplemembership provider in mvc-4, trying seed registration details few users, below

public class contextinitializer : dropcreatedatabasealways<accountscontext> {     protected override void seed(accountscontext context)     {         base.seed(context);         context.userprofiles.add(new userprofile { userid = 1, username = "admin" });         context.userprofiles.add(new userprofile { userid = 2, username = "user1" });                 } } 

but unable set password & confirmpassword, since not found in userprofile class. located in registermodel class, not accessed directly accountscontext.

can't this?

simplemembershipprovider _membership = membership.provider; _membership.createuserandaccount("username", "password"); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -