protected override void Seed(SynergyDbContext context) { context.Synergy_API.Add(new Synergy_Api() { Api = ApiTypes.AgileCrm.ToString() }); context.Synergy_API.Add(new Synergy_Api() { Api = ApiTypes.Infusion.ToString() }); context.Synergy_API.Add(new Synergy_Api() { Api = ApiTypes.HubSpot.ToString() }); var Synergy_User = new Synergy_User() { IsActive = true, FirstName = "admin", LastName = "admin", UserRole = "admin" }; context.Synergy_Users.Add(Synergy_User); context.SaveChanges(); context.Synergy_Accounts.Add(new Synergy_Account() { IsActive = true, UserId = Synergy_User.UserId, Password = PasswordEncription.CreateSHAHash("BistroMDSystem"), UserName = "******" }); context.SaveChanges(); base.Seed(context); }
private static void Add(Synergy_User user, string username) { using (var _context = new SynergyDbContext()) { _context.Synergy_Users.Add(user); _context.SaveChanges(); Synergy_Account account = new Synergy_Account() { IsActive = true, Password = PasswordEncription.CreateSHAHash("Pa$$word"), UserName = username, UserId = user.UserId }; _context.Synergy_Accounts.Add(account); _context.SaveChanges(); } }
public static void Create(Synergy_User user, string username) { Add(user, username); }