本文整理汇总了C#中Rock.Model.PersonService.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# PersonService.ToList方法的具体用法?C# PersonService.ToList怎么用?C# PersonService.ToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.PersonService
的用法示例。
在下文中一共展示了PersonService.ToList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parents
/// <summary>
/// Gets the parents of the person
/// </summary>
/// <param name="context">The context.</param>
/// <param name="input">The input.</param>
/// <returns></returns>
public static List<Person> Parents( DotLiquid.Context context, object input )
{
var person = GetPerson( input );
if ( person != null )
{
Guid adultGuid = Rock.SystemGuid.GroupRole.GROUPROLE_FAMILY_MEMBER_ADULT.AsGuid();
var parents = new PersonService( new RockContext() ).GetFamilyMembers( person.Id ).Where( m => m.GroupRole.Guid == adultGuid ).Select( a => a.Person );
return parents.ToList();
}
return new List<Person>();
}
示例2: Children
/// <summary>
/// Gets the children of the person
/// </summary>
/// <param name="context">The context.</param>
/// <param name="input">The input.</param>
/// <returns></returns>
public static List<Person> Children( DotLiquid.Context context, object input )
{
var person = GetPerson( input );
if ( person != null )
{
Guid childGuid = Rock.SystemGuid.GroupRole.GROUPROLE_FAMILY_MEMBER_CHILD.AsGuid();
var children = new PersonService( new RockContext() ).GetFamilyMembers( person.Id ).Where( m => m.GroupRole.Guid == childGuid ).Select( a => a.Person );
return children.ToList();
}
return new List<Person>();
}