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