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