Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal sealed class Configuration : DbMigrationsConfiguration<Bookmarks.Data.BookmarksContext>
- {
- public Configuration()
- {
- AutomaticMigrationsEnabled = true;
- ContextKey = "Bookmarks.Data.BookmarksContext";
- }
- protected override void Seed(Bookmarks.Data.BookmarksContext context)
- {
- if (context.Bookmarks.Any())
- {
- return;
- }
- var pesho = new User()
- {
- UserName = "pesho@goshov.com",
- Email = "pesho@goshov.com"
- };
- var gosho = new User()
- {
- UserName = "gosho@peshev.com",
- Email = "gosho@peshev.com"
- };
- var userManager = new UserManager<User>(new UserStore<User>(context));
- userManager.Create(pesho, "123");
- userManager.Create(gosho, "123");
- context.SaveChanges();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement