Exemple #1
0
        public static List <BodyTypes> GetBodyType(VehicleContext db)
        {
            List <BodyTypes> allBodyTypes = new List <BodyTypes>();
            BodyTypes        mySedan      = new BodyTypes();

            mySedan.BodyType    = new Sedan().BodyType;
            mySedan.VehicleType = new Sedan().VehicleType;

            BodyTypes myHatchBack = new BodyTypes();

            myHatchBack.BodyType    = new Hatchback().BodyType;
            myHatchBack.VehicleType = new Hatchback().VehicleType;

            allBodyTypes.Add(mySedan);
            allBodyTypes.Add(myHatchBack);



            return(allBodyTypes);
        }
Exemple #2
0
        public static List <Vehicle> GetAllVehicles(VehicleContext db)
        {
            Vehicle        car, car2, bike;
            List <Vehicle> vehicles = new List <Vehicle>();

            car = new Vehicle()
            {
                Make         = "2012",
                Model        = "BMW Z3",
                EngineDetail = "Some detail",
                Wheels       = 4,
                Doors        = 4,
                BodyType     = new Sedan().BodyType,
                VehicleType  = "car"
            };

            car2 = new Vehicle()
            {
                Make         = "2016",
                Model        = "BMW Z4",
                EngineDetail = "Some detail",
                Wheels       = 4,
                Doors        = 4,
                BodyType     = new Hatchback().BodyType,
                VehicleType  = "car"
            };
            bike = new Vehicle()
            {
                Make         = "2016",
                Model        = "Yamaha R1",
                EngineDetail = "Some detail",
                Wheels       = 2,
                VehicleType  = "bike"
            };
            vehicles.Add(car);
            vehicles.Add(car2);
            vehicles.Add(bike);


            return(vehicles);
        }