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