/// <summary>
 /// Adds the specified instance.
 /// </summary>
 /// <param name="instance">The instance.</param>
 public void Add(UploadImage2 instance)
 {
     using (ImageCropEntities db = new ImageCropEntities())
     {
         db.UploadImage2.AddObject(instance);
         db.SaveChanges();
     }
 }
        /// <summary>
        /// 建立新 UploadImage2 物件。
        /// </summary>
        /// <param name="id">ID 屬性的初始值。</param>
        /// <param name="originalImage">OriginalImage 屬性的初始值。</param>
        /// <param name="createDate">CreateDate 屬性的初始值。</param>
        /// <param name="updateDate">UpdateDate 屬性的初始值。</param>
        public static UploadImage2 CreateUploadImage2(global::System.Guid id, global::System.String originalImage, global::System.DateTime createDate, global::System.DateTime updateDate)
        {
            UploadImage2 uploadImage2 = new UploadImage2();

            uploadImage2.ID            = id;
            uploadImage2.OriginalImage = originalImage;
            uploadImage2.CreateDate    = createDate;
            uploadImage2.UpdateDate    = updateDate;
            return(uploadImage2);
        }
 /// <summary>
 /// Updates the specified instance.
 /// </summary>
 /// <param name="instance">The instance.</param>
 public void Update(UploadImage2 instance)
 {
     using (ImageCropEntities db = new ImageCropEntities())
     {
         var target = db.UploadImage2.SingleOrDefault(x => x.ID == instance.ID);
         target.CropImage   = instance.CropImage;
         target.SelectionX1 = instance.SelectionX1;
         target.SelectionX2 = instance.SelectionX2;
         target.SelectionY1 = instance.SelectionY1;
         target.SelectionY2 = instance.SelectionY2;
         target.UpdateDate  = DateTime.Now;
         db.SaveChanges();
     }
 }
 /// <summary>
 /// 將新物件加入 UploadImage2 EntitySet 的方法已被取代。請考慮改為使用關聯的 ObjectSet&lt;T&gt; 屬性的 .Add 方法。
 /// </summary>
 public void AddToUploadImage2(UploadImage2 uploadImage2)
 {
     base.AddObject("UploadImage2", uploadImage2);
 }