Rock.Model.GroupServiceExtensions.HeadOfHousehold C# (CSharp) 메소드

HeadOfHousehold() 공개 정적인 메소드

Given an IQueryable of members (i.e. family members), returns the head of household for those members
public static HeadOfHousehold ( this members ) : Person
members this The members.
리턴 Person
        public static Person HeadOfHousehold( this IQueryable<GroupMember> members )
        {
            return members
                .OrderBy( m => m.GroupRole.Order )
                .ThenBy( m => m.Person.Gender )
                .ThenBy( m => m.Person.BirthYear )
                .ThenBy( m => m.Person.BirthMonth )
                .ThenBy( m => m.Person.BirthDay )
                .Select( m => m.Person )
                .FirstOrDefault();
        }