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

GetByParentGroupIdAndName() public method

Returns an enumerable collection of Rock.Model.Group">Groups by the Id of their parent
public GetByParentGroupIdAndName ( int parentGroupId, string name ) : IQueryable
parentGroupId int An representing the Id of the parent to search by.
name string A containing the Name of the to search by.
return IQueryable
        public IQueryable<Group> GetByParentGroupIdAndName( int? parentGroupId, string name )
        {
            return Queryable().Where( t => ( t.ParentGroupId == parentGroupId || ( parentGroupId == null && t.ParentGroupId == null ) ) && t.Name == name );
        }