public SavedPrescription Clone() { SavedPrescription newItem = new SavedPrescription(); newItem._Id = this._Id; newItem._Title = this._Title; newItem.SavedPrescriptionDrugs = new System.Data.Objects.DataClasses.EntityCollection<SavedPrescriptionDrug>(); for (int i = 0; i < this.SavedPrescriptionDrugs.Count; i++) { //newItem.SavedPrescriptionDrugs.Add(this.SavedPrescriptionDrugs.ElementAt(i).Clone()); } //DataLayer.Detach(newItem); newItem.EntityKey = this.EntityKey; return newItem; }
/// <summary> /// Deprecated Method for adding a new object to the SavedPrescriptions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSavedPrescriptions(SavedPrescription savedPrescription) { base.AddObject("SavedPrescriptions", savedPrescription); }
/// <summary> /// Create a new SavedPrescription object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="title">Initial value of the Title property.</param> public static SavedPrescription CreateSavedPrescription(global::System.Int32 id, global::System.String title) { SavedPrescription savedPrescription = new SavedPrescription(); savedPrescription.Id = id; savedPrescription.Title = title; return savedPrescription; }