Ejemplo n.º 1
0
 public static List <CellphoneEntity> CellphoneList()
 {
     using (var bd = new CellphoneContext())
     {
         return(bd.Cellphones.ToList());
     }
 }
Ejemplo n.º 2
0
 public static void DeleteCellphone(CellphoneEntity oCellphone)
 {
     using (var bd = new CellphoneContext())
     {
         bd.Cellphones.Remove(oCellphone);
         bd.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public static CellphoneEntity GetCellphoneById(string id)
 {
     using (var bd = new CellphoneContext())
     {
         return(bd.Cellphones.FirstOrDefault
                    (c => c.Id == id));
     }
 }
Ejemplo n.º 4
0
 public static void CreateCellphone(CellphoneEntity oCellphone)
 {
     using (var bd = new CellphoneContext())
     {
         bd.Cellphones.Add(oCellphone);
         bd.SaveChanges();
     }
 }