// GET api/parent/5 public ParentApiModel Get(int id) { ParentApiModel parent = new ParentApiModel(); parent.get(id); return(parent); }
// GET api/parent public List <ParentApiModel> Get() { List <ParentApiModel> Parents = new List <ParentApiModel>(); ParentApiModel p1 = new ParentApiModel(); DataTable dt = p1.getList(); foreach (DataRow dr in dt.Rows) { ParentApiModel p = new ParentApiModel(); p.get(Convert.ToInt32(dr["ID"])); Parents.Add(p); } return(Parents); }