public static bool Create(Entrenador entity) { using (var db = new SirindarDbContext()) { try { db.Entry(entity); db.SaveChanges(); } catch (Exception) { return false; } } return true; }
public static Entrenador Read(int id) { var entity = new Entrenador(); using (var db = new SirindarDbContext()) { try { entity = db.Entrenadores.Find(id); } catch (Exception) { return null; } } return entity; }