public IChair CreateChair(string model, string materialType, decimal price, decimal height, int numberOfLegs) { if (!this.Chairs.Any(c => c.Model == model)) { IChair chair = new Chair(model, GetMaterialType(materialType).ToString(), price, height, numberOfLegs); this.Chairs.Add(chair); return chair; } return null; }
public IChair CreateChair(string model, string materialType, decimal price, decimal height, int numberOfLegs) { var chair = new Chair(model, this.GetMaterialType(materialType), price, height, numberOfLegs); return chair; }
public IChair CreateChair(string model, string materialType, decimal price, decimal height, int numberOfLegs) { MaterialType type = GetMaterialType(materialType); Chair createdChair = new Chair(model, type, price, height, numberOfLegs); return createdChair; }