Beispiel #1
0
 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;
 }
Beispiel #2
0
 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;
 }