internal PurchasedCar ToPurchasedCar() { var tires = new TirePackage { Size = 16, Weight = 40 }; var car = new PurchasedCar { CustomerName = "Me", Engine = GetEngine(), Tires = tires }; return car; }
/// <summary> /// Create a new TirePackage object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="size">Initial value of the Size property.</param> /// <param name="weight">Initial value of the Weight property.</param> public static TirePackage CreateTirePackage(global::System.Int32 id, global::System.Int32 size, global::System.Int32 weight) { TirePackage tirePackage = new TirePackage(); tirePackage.Id = id; tirePackage.Size = size; tirePackage.Weight = weight; return(tirePackage); }
internal PurchasedCar ToPurchasedCar() { var tires = new TirePackage { Size = 16, Weight = 40 }; var car = new PurchasedCar { CustomerName = "Me", Engine = GetEngine(), Tires = tires }; return(car); }
public void PurchaseCar(CarType type) { var tires = new TirePackage {Size = 16, Weight = 40}; Engine engine = type == CarType.Basic ? new Engine {Cylinders = 4, Horsepower = 120} : new Engine {Cylinders = 8, Horsepower = 200}; var car = new PurchasedCar {CustomerName = "Me", Engine = engine, Tires = tires}; var context = new Entities(); context.AddToPurchasedCars(car); context.SaveChanges(); }
public void PurchaseCar(CarType type) { var tires = new TirePackage { Size = 16, Weight = 40 }; Engine engine = type == CarType.Basic ? new Engine { Cylinders = 4, Horsepower = 120 } : new Engine { Cylinders = 8, Horsepower = 200 }; var car = new PurchasedCar { CustomerName = "Me", Engine = engine, Tires = tires }; var context = new Entities(); context.AddToPurchasedCars(car); context.SaveChanges(); }
/// <summary> /// Create a new TirePackage object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="size">Initial value of the Size property.</param> /// <param name="weight">Initial value of the Weight property.</param> public static TirePackage CreateTirePackage(global::System.Int32 id, global::System.Int32 size, global::System.Int32 weight) { TirePackage tirePackage = new TirePackage(); tirePackage.Id = id; tirePackage.Size = size; tirePackage.Weight = weight; return tirePackage; }
/// <summary> /// Deprecated Method for adding a new object to the TirePackages EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTirePackages(TirePackage tirePackage) { base.AddObject("TirePackages", tirePackage); }