public IEnumerable <Fruit> GetAll()
        {
            var result = _fruitService.GetFruits(); //_context.FruitItems.ToList();

            Console.WriteLine(result);
            return(result);
        }
Example #2
0
 public ActionResult <IEnumerable <Fruit> > GetFruits()
 {
     try
     {
         var fruits = _fruitService.GetFruits();
         return(Ok(fruits));
     }
     catch (Exception)
     {
         return(StatusCode(500));
     }
 }
Example #3
0
 public string MixIt()
 {
     return(string.Join(",", fruit.GetFruits().Select(x => x.Name).ToArray()));
 }
Example #4
0
 public ActionResult <IEnumerable <Fruit> > Get()
 {
     return(_fruitService.GetFruits());
 }