public ActionResult Insert(string Name) { Student_Relations std = new Student_Relations(); std.Name = Name; db.Student_Relations.Add(std); db.SaveChanges(); return(Json("Save Successfully", JsonRequestBehavior.AllowGet)); }
public ActionResult AddRelations(Student_Relations SRelation) { HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://192.168.0.119:3000/"); var response = client.PostAsJsonAsync("studentRelation/AddRelations", SRelation).Result; if (response.IsSuccessStatusCode) { Console.Write("Success"); } else { Console.Write("Error"); } return(View(SRelation)); }