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"); }
public AddCarWindow() { InitializeComponent(); DataContext = new CarPub(); }