public void update(int id, Class entities) { var classdetail = context.classes.FirstOrDefault(e => e.ClassId == id); if (classdetail != null) { classdetail.ClassId = entities.ClassId; classdetail.ClassName = entities.ClassName; classdetail.Description = entities.Description; context.SaveChanges(); } }
public void update(int id, Course entities) { var coursedetail = context.Courses.FirstOrDefault(e => e.CourseId == id); if (coursedetail != null) { coursedetail.CourseId = entities.CourseId; coursedetail.CourseName = entities.CourseName; coursedetail.Description = entities.Description; context.SaveChanges(); } }
public void update(int id, School entities) { var schooldetail = context.Schools.FirstOrDefault(e => e.Id == id); if (schooldetail != null) { schooldetail.Id = entities.Id; schooldetail.SchoolName = entities.SchoolName; schooldetail.SchoolType = entities.SchoolType; schooldetail.City = entities.City; schooldetail.Country = entities.Country; context.SaveChanges(); } }
public void update(int id, Student entities) { var studentdetail = context.Students.FirstOrDefault(e => e.Id == id); if (studentdetail != null) { studentdetail.Id = entities.Id; studentdetail.Name = entities.Name; studentdetail.DOB = entities.DOB; studentdetail.Gender = entities.Gender; studentdetail.City = entities.City; studentdetail.ClassId = entities.ClassId; studentdetail.CourseId = entities.CourseId; studentdetail.SchoolId = entities.SchoolId; context.SaveChanges(); } }
public Student AddStudent(Student student) { context.Add(student); context.SaveChanges(); return(student); }
public int Complete() { return(_context.SaveChanges()); }
public void Add(TEntity entities) { context.Set <TEntity>().Add(entities); context.SaveChanges(); }