C# Class Rock.Model.GroupMemberService

The data access/service class for Rock.Model.GroupMember entity objects.
Show file Open project: NewSpring/Rock Class Usage Examples

Public Methods

Method Description
CreateKnownRelationship ( int personId, int relatedPersonId, int relationshipRoleId ) : void

Creates the known relationship.

DeleteKnownRelationship ( int personId, int relatedPersonId, int relationshipRoleId ) : void

Deletes the known relationship.

Get ( System.Guid guid ) : GroupMember

Gets the specified unique identifier.

Get ( int id ) : GroupMember

Gets the specified identifier.

GetByGroupGuid ( System.Guid groupGuid, bool includeDeceased = false ) : IQueryable

Returns a queryable collection of GroupMembers who are members of a specific group.

GetByGroupId ( int groupId, bool includeDeceased = false ) : IQueryable

Returns a queryable collection of GroupMembers who are members of a specific group.

GetByGroupIdAndPersonId ( int groupId, int personId, bool includeDeceased = false ) : IQueryable

Returns a collection of Rock.Model.GroupMember">GroupMembers by the Id of the Rock.Model.Person.

GetByGroupIdAndPersonIdAndGroupRoleId ( int groupId, int personId, int groupRoleId, bool includeDeceased = false ) : GroupMember

Returns the first Rock.Model.GroupMember that mathces the Id of the Rock.Model.Group, the Id of the Rock.Model.Person, and the Id fo the Rock.Model.GroupTypeRole

In theory a maximum of one result should be returned, since there is a unique constraint on GroupId, PersonId, and GroupRoleId.

GetByGroupRoleId ( int groupRoleId, bool includeDeceased = false ) : IQueryable

Returns a queryable collection of Rock.Model.GroupMember">GroupMembers by the Id of the

GetByPersonId ( int personId ) : IQueryable

Returns a queryable collection of Rock.Model.GroupMember entities associated with a Rock.Model.Person by the Person's PersonId

GetFirstNames ( int groupId, bool includeDeceased = false ) : IEnumerable

Returns an enumerable collection of System.String objects representing the first names of each person in a Rock.Model.Group ordered by group role, age, and gender

GetFirstNames ( int groupId, bool includeDeceased, bool includeInactive ) : IEnumerable

Returns an enumerable collection of System.String objects representing the first names of each person in a Rock.Model.Group ordered by group role, age, and gender

GetInverseRelationship ( GroupMember groupMember, bool createGroup ) : GroupMember

Gets the inverse relationship. Returns the Rock.Model.GroupMember who has an inverse relationship to the provided Rock.Model.GroupMember.

In Rock, examples of inverse relationships include: Parent/Child, Can Check In/Check in By, Sibling/Sibling, Grandparent/Grandchild, etc.

GetKnownRelationship ( int personId, int relationshipRoleId ) : IQueryable

Gets all group members that have a known relationship of relationshipRoleId type with personId.

GetLeaders ( int groupId ) : IQueryable

Gets the active leaders of the group

GetPerson ( int groupMemberId ) : Person

Gets the person.

GetPersonIdsByHomeAddress ( string partialHomeAddress ) : IQueryable

Gets a list of System.Int32 PersonIds who's home address matches the given search value.

Queryable ( ) : IQueryable

Returns a queryable collection of GroupMembers, excluding deceased group members

Queryable ( bool includeDeceased ) : IQueryable

Returns a queryable collection of GroupMember's.

Queryable ( string includes ) : IQueryable

Returns a collection of all GroupMembers with eager loading of properties specfied in includes

Queryable ( string includes, bool includeDeceased ) : IQueryable

Returns a queryable collection of all GroupMembers with eager loading of properties specfied in includes

Method Details

CreateKnownRelationship() public method

Creates the known relationship.
public CreateKnownRelationship ( int personId, int relatedPersonId, int relationshipRoleId ) : void
personId int The person identifier.
relatedPersonId int The related person identifier.
relationshipRoleId int The relationship role identifier.
return void

DeleteKnownRelationship() public method

Deletes the known relationship.
public DeleteKnownRelationship ( int personId, int relatedPersonId, int relationshipRoleId ) : void
personId int The person identifier.
relatedPersonId int The related person identifier.
relationshipRoleId int The relationship role identifier.
return void

Get() public method

Gets the specified unique identifier.
public Get ( System.Guid guid ) : GroupMember
guid System.Guid The unique identifier.
return GroupMember

Get() public method

Gets the specified identifier.
public Get ( int id ) : GroupMember
id int The identifier.
return GroupMember

GetByGroupGuid() public method

Returns a queryable collection of GroupMembers who are members of a specific group.
public GetByGroupGuid ( System.Guid groupGuid, bool includeDeceased = false ) : IQueryable
groupGuid System.Guid A representing the Guid of a to search by.
includeDeceased bool A value indicating if deceased GroupMembers should be included. If true /// deceased group members will be included, if false deceased group members will not be included. This parameter defaults to false.
return IQueryable

GetByGroupId() public method

Returns a queryable collection of GroupMembers who are members of a specific group.
public GetByGroupId ( int groupId, bool includeDeceased = false ) : IQueryable
groupId int A representing the Id of a to search by.
includeDeceased bool A value indicating if deceased GroupMembers should be included. If true /// deceased group members will be included, if false deceased group members will not be included. This parameter defaults to false.
return IQueryable

GetByGroupIdAndPersonId() public method

Returns a collection of Rock.Model.GroupMember">GroupMembers by the Id of the Rock.Model.Person.
public GetByGroupIdAndPersonId ( int groupId, int personId, bool includeDeceased = false ) : IQueryable
groupId int An representing the Id of the to search by.
personId int An representing the Id of the to search by.
includeDeceased bool A value indicating if deceased GroupMembers should be included. If true /// deceased group members will be included, if false deceased group members will not be included. This parameter defaults to false.
return IQueryable

GetByGroupIdAndPersonIdAndGroupRoleId() public method

Returns the first Rock.Model.GroupMember that mathces the Id of the Rock.Model.Group, the Id of the Rock.Model.Person, and the Id fo the Rock.Model.GroupTypeRole
In theory a maximum of one result should be returned, since there is a unique constraint on GroupId, PersonId, and GroupRoleId.
public GetByGroupIdAndPersonIdAndGroupRoleId ( int groupId, int personId, int groupRoleId, bool includeDeceased = false ) : GroupMember
groupId int An representing the Id of the to search by.
personId int An representing the Id of the to search by.
groupRoleId int A representing the Id of the to search by.
includeDeceased bool A value indicating if deceased GroupMembers should be included. If true /// deceased group members will be included, if false deceased group members will not be included. This parameter defaults to false.
return GroupMember

GetByGroupRoleId() public method

Returns a queryable collection of Rock.Model.GroupMember">GroupMembers by the Id of the
public GetByGroupRoleId ( int groupRoleId, bool includeDeceased = false ) : IQueryable
groupRoleId int An representing the Id of the to search by.
includeDeceased bool A value indicating if deceased GroupMembers should be included. If true /// deceased group members will be included, if false deceased group members will not be included. This parameter defaults to false.
return IQueryable

GetByPersonId() public method

Returns a queryable collection of Rock.Model.GroupMember entities associated with a Rock.Model.Person by the Person's PersonId
public GetByPersonId ( int personId ) : IQueryable
personId int An representing the Id of the to search by.
return IQueryable

GetFirstNames() public method

Returns an enumerable collection of System.String objects representing the first names of each person in a Rock.Model.Group ordered by group role, age, and gender
public GetFirstNames ( int groupId, bool includeDeceased = false ) : IEnumerable
groupId int A representing the Id of the .
includeDeceased bool A value indicating if deceased GroupMembers should be included. If true /// deceased group members will be included, if false deceased group members will not be included. This parameter defaults to false.
return IEnumerable

GetFirstNames() public method

Returns an enumerable collection of System.String objects representing the first names of each person in a Rock.Model.Group ordered by group role, age, and gender
public GetFirstNames ( int groupId, bool includeDeceased, bool includeInactive ) : IEnumerable
groupId int A representing the Id of the .
includeDeceased bool A value indicating if deceased GroupMembers should be included. If true /// deceased group members will be included, if false deceased group members will not be included. This parameter defaults to false.
includeInactive bool if set to true [include inactive].
return IEnumerable

GetInverseRelationship() public method

Gets the inverse relationship. Returns the Rock.Model.GroupMember who has an inverse relationship to the provided Rock.Model.GroupMember.
In Rock, examples of inverse relationships include: Parent/Child, Can Check In/Check in By, Sibling/Sibling, Grandparent/Grandchild, etc.
public GetInverseRelationship ( GroupMember groupMember, bool createGroup ) : GroupMember
groupMember GroupMember A representing the person to find the inverse relationship for.
createGroup bool A flag indicating if a new can be created /// for the person with the inverse relationship.
return GroupMember

GetKnownRelationship() public method

Gets all group members that have a known relationship of relationshipRoleId type with personId.
public GetKnownRelationship ( int personId, int relationshipRoleId ) : IQueryable
personId int The person identifier.
relationshipRoleId int The relationship role identifier.
return IQueryable

GetLeaders() public method

Gets the active leaders of the group
public GetLeaders ( int groupId ) : IQueryable
groupId int The group identifier.
return IQueryable

GetPerson() public method

Gets the person.
public GetPerson ( int groupMemberId ) : Person
groupMemberId int The group member identifier.
return Person

GetPersonIdsByHomeAddress() public method

Gets a list of System.Int32 PersonIds who's home address matches the given search value.
public GetPersonIdsByHomeAddress ( string partialHomeAddress ) : IQueryable
partialHomeAddress string a partial address search string
return IQueryable

Queryable() public method

Returns a queryable collection of GroupMembers, excluding deceased group members
public Queryable ( ) : IQueryable
return IQueryable

Queryable() public method

Returns a queryable collection of GroupMember's.
public Queryable ( bool includeDeceased ) : IQueryable
includeDeceased bool A value indicating if deceased members should be included in the results. If true deceased members will /// be included, otherwise false.
return IQueryable

Queryable() public method

Returns a collection of all GroupMembers with eager loading of properties specfied in includes
public Queryable ( string includes ) : IQueryable
includes string The includes.
return IQueryable

Queryable() public method

Returns a queryable collection of all GroupMembers with eager loading of properties specfied in includes
public Queryable ( string includes, bool includeDeceased ) : IQueryable
includes string A containing a list of properties to be eagerly loaded.
includeDeceased bool A value indicating if deceased GroupMembers should be included. If true /// deceased group members will be included, if false deceased group members will not be included. This parameter defaults to false.
return IQueryable