public void Add(Picture entity) { using (var db = new BatikStoreEntities()) { db.Pictures.AddObject(entity); db.SaveChanges(); } }
public void Update(Picture entity) { using (var db = new BatikStoreEntities()) { var existing = db.Pictures.SingleOrDefault(c => c.Id == entity.Id); if (existing != null) { db.Pictures.ApplyCurrentValues(entity); db.SaveChanges(); } } }
public ResponseMessage Update(Picture entity) { ResponseMessage response = new ResponseMessage(); _pictureRepository.Update(entity); return response; }
public void Add(Picture entity) { _pictureRepository.Add(entity); }
/// <summary> /// Create a new Picture object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="url">Initial value of the Url property.</param> /// <param name="product_ProductId">Initial value of the Product_ProductId property.</param> public static Picture CreatePicture(global::System.Int32 id, global::System.String url, global::System.Int32 product_ProductId) { Picture picture = new Picture(); picture.Id = id; picture.Url = url; picture.Product_ProductId = product_ProductId; return picture; }
/// <summary> /// Deprecated Method for adding a new object to the Pictures EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToPictures(Picture picture) { base.AddObject("Pictures", picture); }