public StudentBatch UpdateStdBatch(StudentBatch _studentBatch) { var stdBatch = dbContext.StudentBatches.Attach(_studentBatch); stdBatch.State = Microsoft.EntityFrameworkCore.EntityState.Modified; dbContext.SaveChanges(); return(_studentBatch); }
public StudentBatch RemoveStdBatch(Guid Id) { StudentBatch studentBatch = dbContext.StudentBatches.Find(Id); if (studentBatch != null) { dbContext.StudentBatches.Remove(studentBatch); dbContext.SaveChanges(); } return(studentBatch); }
public StudentBatch AddStdBatch(StudentBatch _studentBatch) { dbContext.StudentBatches.Add(_studentBatch); dbContext.SaveChanges(); return(_studentBatch); }