public Car(BreakModule breakModule, Chassis chassis, Wheel wheel, Seat seat, Headlight headlight) { this._breakModule = breakModule; this._chassis = chassis; this._wheel = wheel; this._seat = seat; this._headlight = headlight; }
public ActionResult Update(Headlight headlight) { if (!ModelState.IsValid) { return(View(headlight)); } _adminService.Update(headlight); return(RedirectToAction("Index")); }
/// <summary> /// A method to show how AbstractFactory works /// </summary> static void CreateHeadlight(string carModel) { AbstractCarFactory carFactory = null; Console.WriteLine("Creating Headlight"); switch (carModel) { case "Ford": carFactory = new FordCarFactory(); break; case "Dodge": carFactory = new DodgeCarFactory(); break; default: break; } Headlight headlight = carFactory.CreateHeadlight(); Console.WriteLine($"Created Headlight and the name = {headlight.Name}"); }
public Client(Factory factory) { headlight = factory.makeHeadlight(); tire = factory.makeTire(); }