public async Task <IHttpActionResult> DeleteUser(string email) { try { var user_obj = db.UserInfoes.FirstOrDefault((p) => p.email == email); user_obj.is_delete = "true"; db.SaveChanges(); return(Ok(200)); }catch (Exception e) { return(Ok(400)); } }
public ActionResult AddStudent(Student student) { if (ModelState.IsValid) { //Student class Student studentObj = new Student(); studentObj.Name = student.Name; studentObj.Fname = student.Fname; studentObj.Email = student.Email; studentObj.Mobile = student.Mobile; studentObj.Description = student.Description; dbObj.Students.Add(studentObj); dbObj.SaveChanges(); } ModelState.Clear(); return(View("Student")); }