Rock.Model.GroupService.GetByParentGroupId C# (CSharp) Method

GetByParentGroupId() public method

Returns a collection of Rock.Model.Group">Groups by the Id of its parent
public GetByParentGroupId ( int parentGroupId ) : IQueryable
parentGroupId int A representing the Id of the parent to search by. This value /// is nullable and a null value will search for Groups that do not inherit from other groups.
return IQueryable
        public IQueryable<Group> GetByParentGroupId( int? parentGroupId )
        {
            return Queryable().Where( t => ( t.ParentGroupId == parentGroupId || ( parentGroupId == null && t.ParentGroupId == null ) ) );
        }