public DonutTypeEnum randomDonutType() { Array values = Enum.GetValues(typeof(DonutTypeEnum)); DonutTypeEnum randomDonutType = (DonutTypeEnum)values.GetValue(random.Next(values.Length)); return(randomDonutType); }
public Donut(string Name, int Id, double Price, DonutTypeEnum Filling) { this.Name = Name; this.Id = Id; this.Price = Price; this.Filling = Filling; }
public Donut GetDonutByType(DonutTypeEnum type) { foreach (var donut in context.catalog.products.ToArray()) { if (context.catalog.products[donut.Key].Filling == type) { return(context.catalog.products[donut.Key]); } } throw new Exception("There is no donut with this filling in the shop"); }
//Donut public Donut GetDonutByType(DonutTypeEnum type) { return(repository.GetDonutByType(type)); }