Ejemplo n.º 1
0
 private static bool FetchTypesOfSizeFromDB()
 {
     try
     {
         _SizeTypesList = new List <Tuple <string, PizzaBox.Domain.Models.Size> >();
         var SizeListFromDB = _db.Size.ToList();
         foreach (var sizeObjectDB in SizeListFromDB)
         {
             var newSizeType = new PizzaBox.Domain.Models.Size(sizeObjectDB.SizeId, sizeObjectDB.Name, sizeObjectDB.Price, sizeObjectDB.Active);
             _SizeTypesList.Add(Tuple.Create(newSizeType.Name, newSizeType));
         }
     }
     catch (System.Exception)
     {
         System.Console.WriteLine("Unable to collect size types from our services. Please try again later.");
         return(false);
     }
     return(true);
 }
 protected override void AddSize()
 {
     Size = new Size();
 }
 public MeatPizza(Size size)
 {
     Name = "Meat Pizza";
     Size = size;
 }