public static AUTOR get_autor_by_name(string name) { using (BTESTEntities1 context = new BTESTEntities1()) { AUTOR obiectAutor = context.AUTOR.FirstOrDefault(a => a.Nume == name); return(obiectAutor); } }
//schimbare asocieri public static void schimba_autor(CARTE c, AUTOR a) { c.AUTOR = a; c.AutorId = a.AutorId; context2.SaveChanges(); }
public static void adauga_autor(AUTOR a) { context2.AUTOR.Add(a); context2.SaveChanges(); }