// Default contructor that set entity to field public AttachmentModel(Attachment attachment) { this._attachment = attachment; this._id = attachment.Id; this._file_attachments_id = attachment.FileAttachmentsId; this._originalAttachment = attachment.DeepClone(); }
/// <summary> /// Deprecated Method for adding a new object to the Attachment EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToAttachment(Attachment attachment) { base.AddObject("Attachment", attachment); }
/// <summary> /// Create a new Attachment object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="fileAttachmentsId">Initial value of the FileAttachmentsId property.</param> public static Attachment CreateAttachment(global::System.Guid id, global::System.Int32 fileAttachmentsId) { Attachment attachment = new Attachment(); attachment.Id = id; attachment.FileAttachmentsId = fileAttachmentsId; return attachment; }
// Delete a existed Attachment public void DeleteAttachment(Attachment _attachment) { unitOfWork.Delete<Attachment>(_attachment); }
// Add a new Attachment public Attachment AddAttachment(Attachment _attachment) { unitOfWork.Add<Attachment>(_attachment); return _attachment; }
// Update a existed Attachment public Attachment UpdateAttachment(Attachment _attachment) { unitOfWork.Update<Attachment>(_attachment); return _attachment; }
// Refresh an existed Attachment public Attachment RefeshAttachment(Attachment _attachment) { unitOfWork.Refresh<Attachment>(_attachment); return _attachment; }
// Default contructor public AttachmentModel() { this.IsNewItem = true; this._attachment = new Attachment(); }