// GET: api/Categories/5 public Categories Get(int id) { using (mydbformobileEntities1 entities = new mydbformobileEntities1()) { return(entities.Categories.FirstOrDefault(e => e.Id == id)); } }
// GET: api/Categories public IEnumerable <Categories> Get() { using (mydbformobileEntities1 entities = new mydbformobileEntities1()) { return(entities.Categories.ToList()); } }