-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d03d823
commit d8718c5
Showing
66 changed files
with
1,612 additions
and
3,545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,48 +40,45 @@ public void Initialize() | |
_db.Database.Migrate(); | ||
} | ||
|
||
}catch (Exception ex) | ||
}catch (Exception ex) { } | ||
|
||
|
||
|
||
// Create roles if they are not created | ||
if (!_roleManager.RoleExistsAsync(SD.Role_Customer).GetAwaiter().GetResult()) | ||
{ | ||
|
||
_roleManager.CreateAsync(new IdentityRole(SD.Role_Customer)).GetAwaiter().GetResult(); | ||
_roleManager.CreateAsync(new IdentityRole(SD.Role_Employee)).GetAwaiter().GetResult(); | ||
_roleManager.CreateAsync(new IdentityRole(SD.Role_Admin)).GetAwaiter().GetResult(); | ||
_roleManager.CreateAsync(new IdentityRole(SD.Role_Company)).GetAwaiter().GetResult(); | ||
|
||
// Create roles if they are not created | ||
if (!_roleManager.RoleExistsAsync(SD.Role_Customer).GetAwaiter().GetResult()) | ||
|
||
//if roles are not created, then we will create admin user as well | ||
|
||
_userManager.CreateAsync(new ApplicationUser | ||
{ | ||
_roleManager.CreateAsync(new IdentityRole(SD.Role_Customer)).GetAwaiter().GetResult(); | ||
_roleManager.CreateAsync(new IdentityRole(SD.Role_Employee)).GetAwaiter().GetResult(); | ||
_roleManager.CreateAsync(new IdentityRole(SD.Role_Admin)).GetAwaiter().GetResult(); | ||
_roleManager.CreateAsync(new IdentityRole(SD.Role_Company)).GetAwaiter().GetResult(); | ||
|
||
|
||
//if roles are not created, then we will create admin user as well | ||
|
||
_userManager.CreateAsync(new ApplicationUser | ||
{ | ||
UserName = "[email protected]", | ||
Email = "[email protected]", | ||
Name = "Abrar Khalifa", | ||
PhoneNumber = "6353666071", | ||
StreetAddress = "Barkociya Road", | ||
State = "Gujarat", | ||
City = "Nadiad", | ||
PostalCode = "387001" | ||
}, "admin@1234").GetAwaiter().GetResult(); | ||
|
||
|
||
ApplicationUser user = _db.ApplicationUsers.FirstOrDefault(u=>u.Email == "[email protected]"); | ||
|
||
_userManager.AddToRoleAsync(user, SD.Role_Admin).GetAwaiter().GetResult(); | ||
|
||
|
||
|
||
} | ||
UserName = "[email protected]", | ||
Email = "[email protected]", | ||
Name = "Abrar Khalifa", | ||
PhoneNumber = "6353666071", | ||
StreetAddress = "Barkociya Road", | ||
State = "Gujarat", | ||
PostalCode = "387001", | ||
City = "Nadiad" | ||
}, "Admin@1234").GetAwaiter().GetResult(); | ||
|
||
return; | ||
|
||
ApplicationUser user = _db.ApplicationUsers.FirstOrDefault(u => u.Email == "[email protected]"); | ||
|
||
_userManager.AddToRoleAsync(user, SD.Role_Admin).GetAwaiter().GetResult(); | ||
|
||
} | ||
|
||
return; | ||
|
||
|
||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
Bulky.DataAccess/Migrations/20240701114454_addCategoryToDb.Designer.cs
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
Bulky.DataAccess/Migrations/20240701114454_addCategoryToDb.cs
This file was deleted.
Oops, something went wrong.
69 changes: 0 additions & 69 deletions
69
Bulky.DataAccess/Migrations/20240701120329_seedCategory.Designer.cs
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
Bulky.DataAccess/Migrations/20240701120329_seedCategory.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.