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ı")); } } }
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ı")); } } }