public bool CanDelete( Site item, out string errorMessage, bool includeSecondLvl )
{
errorMessage = string.Empty;
bool canDelete = CanDelete( item, out errorMessage );
if ( canDelete && includeSecondLvl && new Service<Layout>( (RockContext)Context ).Queryable().Where( l => l.SiteId == item.Id ).Any( a => a.Pages.Count() > 0 ) )
{
errorMessage = string.Format( "This {0} has a {1} which is used by a {2}.", Site.FriendlyTypeName, Layout.FriendlyTypeName, Page.FriendlyTypeName );
canDelete = false;
}
return canDelete;
}