コード例 #1
0
        internal Fries GetById(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            return(exists);
        }
コード例 #2
0
        public Fries GetById(int id)
        {
            Fries foundFries = _fr.GetById(id);

            if (foundFries == null)
            {
                throw new Exception("There is no fries with that id");
            }
            return(foundFries);
        }
コード例 #3
0
 public Fries GetFriesById([FromRoute] int id)
 {
     return(_repo.GetById(id));
 }