/// <summary> /// Dodaje nowy obiekt do CarServicesCar. /// </summary> /// <param name="carService">Serwis do dodania.</param> /// <param name="carProduct">Samochód do dodania.</param> public void AddToCarServicesCarCollection(CarService carService, CarProduct carProduct) { ICollection <CarServicesCar> carServicesCarsList = GetCarServicesCarCollection(carService); long Id = carServicesCarsList.OrderByDescending(x => x.Id).First().Id + 1; CarServicesCar carServicesCar = CarServicesCar.CreateCarServicesCar(Id, carService.Id, carProduct.Id); this.DB.CarServicesCars.AddObject(carServicesCar); this.DB.SaveChanges(); }
/// <summary> /// Usuwa CarServicesCar. /// </summary> /// <param name="carServicesCar">Samochód do usunięcia.</param> public void DeleteCarServicesCar(CarServicesCar carServicesCar) { this.DeleteObject(carServicesCar); }