Beispiel #1
0
        public ResultViewModels <IEnumerable <ResturantViewModel> > AllResturants()
        {
            ResultViewModels <IEnumerable <ResturantViewModel> > result
                = new ResultViewModels <IEnumerable <ResturantViewModel> >();

            try
            {
                var restaurantTemp = resturantService.GetAll();
                if (restaurantTemp == null)
                {
                    result.Successed = false;
                    result.Message   = "No Data Found";
                }
                else
                {
                    result.Successed = true;

                    result.Message = "All Data Found";
                    result.Data    = restaurantTemp;
                }
            }
            catch (Exception ex)
            {
                result.Successed = false;
                while (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }
                result.Message = ex.Message;
            }

            return(result);
        }
Beispiel #2
0
 public IEnumerable <ResturantViewModel> AllResturants()
 {
     return(resturantService.GetAll());
 }