public static void SeedData(this KentNoteBookDbContext db) { if (!db.Users.Any()) { var saltString = Crypto.GeneratePasswordSalt(); db.Users.Add(new SystemUser { Id = Guid.NewGuid(), Name = "Admin", NickName = "Admin", PasswordSalt = saltString, Password = Crypto.HashPassword(saltString, "123456"), Email = "*****@*****.**", Mobile = "13811111111", IsActive = true, Status = Status.Enabled }); for (int i = 0; i < 30; i++) { saltString = Crypto.GeneratePasswordSalt(); db.Users.Add(new SystemUser { Id = Guid.NewGuid(), Name = "User" + i, NickName = "User " + i, PasswordSalt = saltString, Password = Crypto.HashPassword(saltString, "123456"), Email = "*****@*****.**", Mobile = "13811111111", IsActive = true, Status = Status.Enabled }); } } db.SaveChanges(); }
public AuthController(KentNoteBookDbContext db, IConfiguration configuration) { _db = db; _configuration = configuration; }
public RoleEditModel(KentNoteBookDbContext db) { this._db = db; }
public PermissionEditModel(KentNoteBookDbContext db) { this._db = db; }
public FileUploadController(KentNoteBookDbContext db, IConfiguration configuration, IHostingEnvironment hostingEnv) { _db = db; _configuration = configuration; _hostingEnv = hostingEnv; }
public SystemRolesModel(KentNoteBookDbContext db) { this._db = db; }
public MenusModel(KentNoteBookDbContext db, IDistributedCache cache) { this._db = db; this._cache = cache; }
public ProfileModel(KentNoteBookDbContext db) { this._db = db; }
public MenuTreeModel(KentNoteBookDbContext db) { this._db = db; }
public DataPermissionsModel(KentNoteBookDbContext db) { this._db = db; }
public UsersModel(KentNoteBookDbContext db) { this._db = db; }
public LoginModel(KentNoteBookDbContext db, IConfiguration configuration, IDistributedCache cache) { this._db = db; this._configuration = configuration; this._cache = cache; }