コード例 #1
0
 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;
 }
コード例 #2
0
        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;
        }
コード例 #3
0
 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;
 }