/// <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; }
private void detach_Answers(Answer entity) { this.SendPropertyChanging(); entity.Question = null; }
private void attach_Answers(Answer entity) { this.SendPropertyChanging(); entity.Question = this; }
partial void DeleteAnswer(Answer instance);
partial void UpdateAnswer(Answer instance);
partial void InsertAnswer(Answer instance);
// 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); }
/// <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); }