public void Add(Programador programador) { using (EasyProjectEntities db = new EasyProjectEntities()) { db.Programadors.Add(programador); db.SaveChanges(); } }
public void Remove(long idProgramador) { using (EasyProjectEntities db = new EasyProjectEntities()) { var prog = db.Programadors.Include(b => b.Conhecimento).FirstOrDefault(b => b.IDProgramador == idProgramador); db.Programadors.Remove(prog); db.SaveChanges(); } }
public void Update(Programador updateProgramador) { using (EasyProjectEntities db = new EasyProjectEntities()) { db.Entry(updateProgramador).State = EntityState.Modified; db.Entry(updateProgramador.Conhecimento).State = EntityState.Modified; db.SaveChanges(); } }
public ConhecimentoRepository(EasyProjectEntities context) { this.context = context; }