public Pizza CreateNewPizza(string crust, string size, List <int> tops) { Pizza p = new Pizza(); p.Id = db.GetPizzaCount() + 1; p.Crust = crust; p.Size = size; decimal cost = 0; if (size == "small") { cost += 5; } else if (size == "medium") { cost += 8; } else { cost += 12; } if (crust == "stuffed") { cost += 2; } if (tops.Count > 2) { cost += (tops.Count - 2); } p.Cost = cost; SavePizza(p); db.AddPizzaToppingEntry(p, tops); return(p); }