Exemple #1
0
        public static bool Where(this IPublishedContent doc, string predicate)
        {
            if (doc == null)
            {
                throw new ArgumentNullException("doc");
            }
            //Totally gonna cheat here
            var dynamicDocumentList = new DynamicPublishedContentList();

            dynamicDocumentList.Add(doc.AsDynamicPublishedContent());
            var filtered = dynamicDocumentList.Where <DynamicPublishedContent>(predicate);

            if (Queryable.Count(filtered) == 1)
            {
                //this node matches the predicate
                return(true);
            }
            return(false);
        }
Exemple #2
0
        public static IQueryable <IPublishedContent> Where(this IEnumerable <IPublishedContent> list, string predicate)
        {
            var dList = new DynamicPublishedContentList(list);

            return(dList.Where <DynamicPublishedContent>(predicate));
        }
		public static IQueryable<IPublishedContent> Where(this IEnumerable<IPublishedContent> list, string predicate)
		{
			var dList = new DynamicPublishedContentList(list);
			return dList.Where<DynamicPublishedContent>(predicate);
		}
		public static bool Where(this IPublishedContent doc, string predicate)
		{
			if (doc == null) throw new ArgumentNullException("doc");
			//Totally gonna cheat here
			var dynamicDocumentList = new DynamicPublishedContentList();
			dynamicDocumentList.Add(doc.AsDynamicPublishedContent());
			var filtered = dynamicDocumentList.Where<DynamicPublishedContent>(predicate);
			if (Queryable.Count(filtered) == 1)
			{
				//this node matches the predicate
				return true;
			}
			return false;
		}
		public bool Where(string predicate)
		{
			//Totally gonna cheat here
			var dynamicDocumentList = new DynamicPublishedContentList();
			dynamicDocumentList.Add(this);
			var filtered = dynamicDocumentList.Where<DynamicPublishedContent>(predicate);
			if (Queryable.Count(filtered) == 1)
			{
				//this node matches the predicate
				return true;
			}
			return false;
		}