public bool Delete(int lessonId, int teacherId) { using (var _dbContext = new simpleDbContext()) { _dbContext.LessonsInfo.Remove(Get(lessonId, teacherId)); return(_dbContext.SaveChanges() > 0); } }
public bool Update(LessonsInfo entity) { using (var _dbContext = new simpleDbContext()) { _dbContext.LessonsInfo.AddOrUpdate(entity); return(_dbContext.SaveChanges() > 0); } }
public bool Update(Teachers entity) { using (var _dbContext = new simpleDbContext()) { _dbContext.Teachers.AddOrUpdate(entity); return(_dbContext.SaveChanges() > 0); } }
public bool Delete(int id) { using (var _dbContext = new simpleDbContext()) { _dbContext.Teachers.Remove(Get(id)); return(_dbContext.SaveChanges() > 0); } }
public LessonsInfo Create(LessonsInfo entity) { using (var _dbContext = new simpleDbContext()) { _dbContext.LessonsInfo.Add(entity); _dbContext.SaveChanges(); return(entity); } }
public Teachers Create(Teachers entity) { using (var _dbContext = new simpleDbContext()) { _dbContext.Teachers.Add(entity); _dbContext.SaveChanges(); return(entity); } }
public Students Create(Students entity) { using (var _dbContext = new simpleDbContext()) { _dbContext.Students.Add(entity); _dbContext.SaveChanges(); return(entity); } }