Пример #1
0
		public List<IEntity> Select(EntityPredicate predicate)
		{
			List<IEntity> found = new List<IEntity>();
			foreach (IEntity entity in _entities)
			{
				if (predicate(entity)) found.Add(entity);
			}
			return found;
		}
Пример #2
0
 public CumulativeRecordPermission(string id, Type entityType, UserRecordPermission initialPermissions, ActivityGrant grant)
 {
     Id = id;
       EntityType = entityType;
       RecordPermission = initialPermissions;
       SourceGrants.Add(grant);
       if(grant.Filter != null) {
     FilterPredicate = grant.Filter.EntityFilter.GetPredicate(entityType);
     QueryPredicate = grant.Filter.QueryFilter.GetPredicate(entityType);
       }
       HasFilter = (FilterPredicate != null);
 }
Пример #3
0
		public bool Any(EntityPredicate predicate)
		{
			foreach (IEntity entity in _entities)
			{
				if (predicate(entity)) return true;
			}
			return false;
		}