public void IniTests() { // Runs before each test. dal = new EntityFrameworkDAL(new GestDepDbContext()); dal.RemoveAllData(); gestDepService = new GestDepService(dal); }
static void Main(string[] args) { IDAL dal = new EntityFrameworkDAL(new GestDepDbContext()); populateDB(dal); displayData(dal); }
//Rental rental = new Rental(new DateTime(2019, 10, 14, 16, 55, 56),30, new DateTime(2019, 10, 14, 16, 54, 56)); public static void PopulateDB() { IDAL dal = new EntityFrameworkDAL(new EcoScooterDbContext()); dal.RemoveAllData(); AddEcoScooter(dal); AddUsers(dal); AddStations(dal); AddScooters(dal); AddRentals(dal); }
public EcoScooterService(EntityFrameworkDAL entityFrameworkDAL) { this.dal = entityFrameworkDAL; if (this.dal.GetAll <EcoScooter>().Count > 0) { this.ecoScooter = this.dal.GetAll <EcoScooter>().First(); } else { this.ecoScooter = null; } this.loggedMember = null; }
public EcoScooterService(EntityFrameworkDAL entityFrameworkDAL) { this.dal = entityFrameworkDAL; try { this.fare = dal.GetAll <EcoScooter.Entities.EcoScooter>().First().Fare; this.discountYounger = dal.GetAll <EcoScooter.Entities.EcoScooter>().First().DiscountYounger; this.maxSpeed = dal.GetAll <EcoScooter.Entities.EcoScooter>().First().MaxSpeed; } catch (Exception) { } this.loggedMember = null; }
static void Main(string[] args) { try { EntityFrameworkDAL dal = new EntityFrameworkDAL(new EcoScooterDbContext()); new Program(dal); }catch (Exception e) { printError(e); Console.WriteLine("Press any key."); Console.ReadLine(); } }
public void IniTests() { dal = new EntityFrameworkDAL(new GestDepDbContext()); dal.RemoveAllData(); }