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
Post a Comment