/// <summary> /// Updates an instance obtained through copy constructor into database. /// </summary> /// public MovieExemplar Update() { VerifyUpdate(); BaseRecord.SetFieldsFrom(this); Movie.MovieExemplars.OnUpdated(BaseRecord); return(BaseRecord); }
/// <summary> /// Updates an instance obtained through copy constructor into database. /// </summary> /// public Movie Update() { VerifyUpdate(); BaseRecord.SetFieldsFrom(this); Database.Movies.OnUpdated(BaseRecord); foreach (MovieExemplar exemplar in MovieExemplars) { MovieExemplars.OnUpdated(exemplar, "Updated Movie"); } return(BaseRecord); }
/// <summary> /// Updates an instance obtained through copy constructor into database. /// </summary> /// public Customer Update() { VerifyUpdate(); Customer customerWithPID = Database.Customers.FindByPersID(PersonID); if (customerWithPID != null && customerWithPID != BaseRecord) { throw new ArgumentException("Customer #" + customerWithPID.ID + " (" + customerWithPID.FullName + ") already has PID " + PersonID); } BaseRecord.SetFieldsFrom(this); Database.Customers.OnUpdated(BaseRecord); return(BaseRecord); }