Beispiel #1
0
 public bool Add <T>(T objeto, medicuriEntities oEntities) where T : class
 {
     try
     {
         var os = oEntities.CreateObjectSet <T>();
         os.AddObject(objeto);
         return(true);
     }
     catch (Exception ex)
     {
         lstErrores.Add(ex.Message);
         return(false);
     }
 }
Beispiel #2
0
 public bool Add <T>(T objeto) where T : class
 {
     using (medicuriEntities oEntities1 = new medicuriEntities())
     {
         try
         {
             var os = oEntities1.CreateObjectSet <T>();
             os.AddObject(objeto);
             oEntities1.SaveChanges();
             return(true);
         }
         catch (Exception ex)
         {
             lstErrores.Add(ex.Message);
             return(false);
         }
     }
 }