示例#1
0
        public ResturantViewModel GetByID(int id)
        {
            Resturant _Resturant          = ResturantRepo.GetByID(id);
            var       restuarantViewModel = _Resturant?.toViewModel();

            if (_Resturant != null)
            {
                restuarantViewModel.SectionName = _Resturant?.Section.Name;
                restuarantViewModel.ResturantImages
                    = _Resturant?.ResturantImages
                      ?.Select(i => i.toViewModel());

                restuarantViewModel.Items
                    = _Resturant?.Items
                      ?.Select(i => i.ToViewModel());
            }

            return(restuarantViewModel);
        }
示例#2
0
        public ResturantViewModel GetByID(int id)
        {
            Resturant _Resturant = ResturantRepo.GetByID(id);

            return(_Resturant.toViewModel());
        }