Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
コード例 #1
0
        /// <summary>
        /// Creates a new <see cref="Answer"/> instance, to be persisted when <see cref="SubmitChanges"/> is called.
        /// </summary>
        /// <param name="userId">The ID of the user creating the instance.</param>
        /// <returns>The new <see cref="Answer"/> instance</returns>
        public Answer CreateAnswer(int userId)
        {
            var answer = new Answer(userId);

            this.Context.Answers.InsertOnSubmit(answer);

            return answer;
        }
コード例 #2
0
		private void detach_Answers(Answer entity)
		{
			this.SendPropertyChanging();
			entity.Question = null;
		}
コード例 #3
0
		private void attach_Answers(Answer entity)
		{
			this.SendPropertyChanging();
			entity.Question = this;
		}
コード例 #4
0
 partial void DeleteAnswer(Answer instance);
コード例 #5
0
 partial void UpdateAnswer(Answer instance);
コード例 #6
0
 partial void InsertAnswer(Answer instance);
コード例 #7
0
        // ReSharper disable UnusedMember.Local
        /// <summary>
        /// Called when a new <see cref="Answer"/> is inserted.
        /// </summary>
        /// <param name="instance">The new <see cref="Answer"/> instance.</param>
partial         void InsertAnswer(Answer instance)
        {
            instance.CreationDate = DateTime.Now;
            instance.RevisionDate = DateTime.Now;
            this.ExecuteDynamicInsert(instance);
        }
コード例 #8
0
        /// <summary>
        /// Called when an existing <see cref="Answer"/> is updated.
        /// </summary>
        /// <param name="instance">The existing <see cref="Answer"/> instance.</param>
partial         void UpdateAnswer(Answer instance)
        {
            instance.RevisionDate = DateTime.Now;
            this.ExecuteDynamicUpdate(instance);
        }