本文整理汇总了C#中Rock.Model.PersonAliasService.Select方法的典型用法代码示例。如果您正苦于以下问题:C# PersonAliasService.Select方法的具体用法?C# PersonAliasService.Select怎么用?C# PersonAliasService.Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.PersonAliasService
的用法示例。
在下文中一共展示了PersonAliasService.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadRockData
/// <summary>
/// Loads Rock data that's used globally by the transform
/// </summary>
private void LoadRockData( RockContext lookupContext = null )
{
lookupContext = lookupContext ?? new RockContext();
// initialize storage providers and file types
LoadStorageProviders();
FileTypes = new BinaryFileTypeService( lookupContext ).Queryable().AsNoTracking().ToList();
// core-specified blacklist files
FileTypeBlackList = ( GlobalAttributesCache.Read().GetValue( "ContentFiletypeBlacklist" )
?? string.Empty ).Split( new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries );
// clean up blacklist
FileTypeBlackList = FileTypeBlackList.Select( a => a.ToLower().TrimStart( new char[] { '.', ' ' } ) );
// get all the file types we'll be importing
var binaryTypeSettings = ConfigurationManager.GetSection( "binaryFileTypes" ) as NameValueCollection;
// create any custom types that don't exist yet
foreach ( var typeKey in binaryTypeSettings.AllKeys )
{
var fileType = FileTypes.FirstOrDefault( f => f.Name == typeKey );
// create new binary file type if it doesn't exist
if ( fileType == null )
{
fileType = new BinaryFileType();
fileType.Name = typeKey;
fileType.Description = typeKey;
fileType.AllowCaching = true;
var typeValue = binaryTypeSettings[typeKey];
if ( typeValue != null )
{
var storageProvider = StorageProviders.FirstOrDefault( p => p.TypeName.RemoveWhitespace().EndsWith( typeValue.RemoveWhitespace() ) );
if ( storageProvider != null )
{
// ensure the storage provider is active
fileType.StorageEntityTypeId = storageProvider.EntityType.Id;
lookupContext.BinaryFileTypes.Add( fileType );
lookupContext.SaveChanges();
FileTypes.Add( fileType );
}
else
{
LogException( "Binary File Import", string.Format( "{0} must use the name of a configured storage provider.", typeKey ) );
}
}
else
{
LogException( "Binary File Import", string.Format( "{0} must specify the storage provider type.", typeKey ) );
}
}
}
// load attributes on file types
foreach ( var type in FileTypes )
{
type.LoadAttributes( lookupContext );
}
// get a list of all the imported people keys
var personAliasList = new PersonAliasService( lookupContext ).Queryable().AsNoTracking().ToList();
ImportedPeople = personAliasList.Select( pa =>
new PersonKeys()
{
PersonAliasId = pa.Id,
PersonId = pa.PersonId,
IndividualId = pa.ForeignId,
} ).ToList();
}