/// <summary> /// Create a new PersonChurch object. /// </summary> /// <param name="churchId">Initial value of the ChurchId property.</param> /// <param name="personId">Initial value of the PersonId property.</param> /// <param name="roleId">Initial value of the RoleId property.</param> public static PersonChurch CreatePersonChurch(global::System.Int32 churchId, global::System.Int32 personId, global::System.Int32 roleId) { PersonChurch personChurch = new PersonChurch(); personChurch.ChurchId = churchId; personChurch.PersonId = personId; personChurch.RoleId = roleId; return personChurch; }
/// <summary> /// Deprecated Method for adding a new object to the PersonChurches EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToPersonChurches(PersonChurch personChurch) { base.AddObject("PersonChurches", personChurch); }
private void SavePersonRole(Person personToSave, int roleId) { var pr = new PersonChurch { RoleId = roleId, ChurchId = personToSave.ChurchId, PersonId = personToSave.PersonId }; Context.AddToPersonChurches(pr); Context.SaveChanges(); }