Exemple #1
0
 public static bool Create(Entrenador entity)
 {
     using (var db = new SirindarDbContext())
     {
         try
         {
             db.Entry(entity);
             db.SaveChanges();
         }
         catch (Exception)
         {
             return false;
         }
     }
     return true;
 }
Exemple #2
0
 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;
 }