Skip to content

Commit

Permalink
Removed seed data for admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
adarsh-vs committed Feb 20, 2014
1 parent 05d73ad commit 9c25a65
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions source/SocialGoal.Data/GoalsSampleData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,6 @@ public class GoalsSampleData : DropCreateDatabaseIfModelChanges<SocialGoalEntiti
{
protected override void Seed(SocialGoalEntities context)
{

var UserManager = new UserManager<ApplicationUser>(new

UserStore<ApplicationUser>(context));

var RoleManager = new RoleManager<IdentityRole>(new
RoleStore<IdentityRole>(context));

string name = "Admin";
string password = "123456";


//Create Role Admin if it does not exist
if (!RoleManager.RoleExists(name))
{
var roleresult = RoleManager.Create(new IdentityRole(name));
}

//Create User=Admin with password=123456
var user = new ApplicationUser();
user.UserName = name;
var adminresult = UserManager.Create(user, password);

//Add User Admin to Role Admin
if (adminresult.Succeeded)
{
var result = UserManager.AddToRole(user.Id, name);
}
//base.Seed(context);
context.Commit();

new List<Metric>
{
new Metric { Type ="%"},
Expand Down

0 comments on commit 9c25a65

Please sign in to comment.