public string delete(API_profile pro) { Application1Entities api = new Application1Entities(); API_profile obj = api.API_profile.Single(x => x.id == pro.id); api.API_profile.Remove(obj); api.SaveChanges(); return("Success"); }
public string update(API_profile pro) { Application1Entities api = new Application1Entities(); API_profile obj = api.API_profile.Single(x => x.id == pro.id); obj.name = pro.name; obj.address = pro.address; api.SaveChanges(); return("Success"); }
public IHttpActionResult detail() { List <API_profile> api_pofiles; using (var context = new Application1Entities()) { api_pofiles = context.API_profile.ToList(); } return(Ok(api_pofiles)); }
public IHttpActionResult search(int sid) { API_profile api_search; using (var context = new Application1Entities()) { api_search = context.API_profile.Where(x => x.id == sid).FirstOrDefault(); } return(Ok(api_search)); }
public string add(API_profile pro) { Application1Entities api = new Application1Entities(); API_profile obj = new API_profile(); obj.id = pro.id; obj.name = pro.name; obj.address = pro.address; api.API_profile.Add(obj); api.SaveChanges(); return("Success"); }