コード例 #1
0
ファイル: BaseTest.cs プロジェクト: 547343578/GestDep
 public void IniTests()
 {
     // Runs before each test.
     dal = new EntityFrameworkDAL(new GestDepDbContext());
     dal.RemoveAllData();
     gestDepService = new GestDepService(dal);
 }
コード例 #2
0
        static void Main(string[] args)
        {
            IDAL dal = new EntityFrameworkDAL(new GestDepDbContext());

            populateDB(dal);
            displayData(dal);
        }
コード例 #3
0
        //Rental rental = new Rental(new Date​Time(2019, 10, 14, 16, 55, 56),30, new Date​Time(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);
        }
コード例 #4
0
 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;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
 public void IniTests()
 {
     dal = new EntityFrameworkDAL(new GestDepDbContext());
     dal.RemoveAllData();
 }