/// <summary> /// 增加一条记录 /// </summary> /// <param name="car">实体</param> /// <returns></returns> public DAO.ImgStock Add(DAO.ImgStock model) { DAO.ImgStock m = db.ImgStock.Add(model); int i = db.SaveChanges(); if (i > 0) { return(m); } else { return(null); } }
/// <summary> /// 获取Model /// </summary> /// <param name="partId"></param> /// <returns></returns> public DAO.ImgStock GetPartModel(int partId) { DAO.ImgStock part = db.ImgStock.Where(m => m.ID == partId).FirstOrDefault(); return(part); }