public BakingType randomBakingType() { Array values = Enum.GetValues(typeof(BakingType)); BakingType randomBakingType = (BakingType)values.GetValue(random.Next(values.Length)); return(randomBakingType); }
public Baking GetBakingByType(BakingType type) { foreach (var baking in context.catalog.products.ToArray()) { if (context.catalog.products[baking.Key].Type == type) { return(context.catalog.products[baking.Key]); } } throw new Exception("There is no baking of this type"); }
public Baking(int Id, double Price, BakingType Type) { this.Id = Id; this.Price = Price; this.Type = Type; }