public ManagersController() { db = new AltranSIWalletContext(); managerRepository = new ManagerRepository(db); userRepository = new UserRepository(db); consultantRepository = new ConsultantRepository(db); }
public DatabaseTest() { ConnectionDatabase.DbContextSettings.ConnectionString = ConnectionDatabase.connString; ConnectionDatabase.DbContextSettings.DatabaseName = dbName; DbContext = new ApplicationDbContext(ConnectionDatabase.DbContextSettings); UserRepository = new UserRepository(DbContext); ConsultantRepository = new ConsultantRepository(DbContext); AccountRepository = new AccountRepository(DbContext); }
public static void AuthenticateConsultant(string username, string password) { ConsultantRepository consultantRepo = new ConsultantRepository(); LoggedConsultant = consultantRepo.GetAll().FirstOrDefault(c => c.Username == username && c.Password == password); }