Пример #1
0
        public void DrinkService_ReadAll()
        {
            var drinkService = new DrinkService();
            var result       = drinkService.ReadAll();

            Assert.IsNotNull(result.FirstOrDefault());
        }
Пример #2
0
 public ActionResult <IEnumerable <Drink> > Get()
 {
     try
     {
         var drinkService = new DrinkService();
         var result       = drinkService.ReadAll();
         return(this.Ok(result));
     }
     catch (System.Exception exception)
     {
         log.LogError(exception, string.Format("{0}: Error in {1}", System.DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod().Name));
         return(this.StatusCode(500));
     }
 }