Пример #1
0
        public ActionResult GetMapById(int id)
        {
            using (FarukYalcinZooContext context = new FarukYalcinZooContext())
            {
                var res = context.Maps.FirstOrDefault(x => x.Id == id);

                if (res != null)
                {
                    return(Ok(res));
                }
                else
                {
                    return(NotFound("malesef bulunamadı"));
                }
            }
        }
Пример #2
0
        public ActionResult GetAll()
        {
            using (FarukYalcinZooContext context = new FarukYalcinZooContext())
            {
                var res = context.Maps.ToList();

                if (res.Count > 0)
                {
                    return(Ok(res));
                }
                else
                {
                    return(NotFound("malesef bulunamadı"));
                }
            }
        }