Esempio n. 1
0
        public string CreateCar(CarPub carToCreate)
        {
            using (var context = new CarRentContext())
            {
                context.Cars.Add(new Model.Car()
                {
                    Brand  = carToCreate.Brand,
                    Colour = carToCreate.Colour,
                    Name   = carToCreate.CarName,
                    Price  = carToCreate.Price
                });
                context.SaveChanges();
            }

            return("Success");
        }
Esempio n. 2
0
 public AddCarWindow()
 {
     InitializeComponent();
     DataContext = new CarPub();
 }