예제 #1
0
 private IQueryable ApplyProperty(IQueryable queryable, FilteringProperty property)
 {
     try
     {
         queryable = queryable.ApplyQuery(
             QueryMethod.Where,
             Lambda.SelectPropertyValue(queryable.ElementType, property.Name, property.Value, _context.QueryFilters))
                     as IQueryable;
         return(queryable);
     }
     catch (ArgumentException ex)
     {
         throw MissingProperty(property.Name, ex);
     }
 }
 private IQueryable ApplyProperty(IQueryable queryable, FilteringProperty property)
 {
     try
     {
         queryable = queryable.ApplyQuery(
             QueryMethod.Where,
             Lambda.SelectPropertyValue(queryable.ElementType, property.Name, property.Value, _context.QueryFilters))
             as IQueryable;
         return queryable;
     }
     catch (ArgumentException ex)
     {
         throw MissingProperty(property.Name, ex);
     }
 }
예제 #3
0
        private IEnumerable ApplyProperty(IEnumerable enumerable, FilteringProperty property)
        {
            try
            {
                var elementType = enumerable
                                  .GetType()
                                  .GetInterface("IEnumerable`1")
                                  .GetGenericArguments()
                                  .First();

                enumerable = enumerable.ApplyQuery(
                    QueryMethod.Where,
                    Lambda.SelectPropertyValue(elementType, property.Name, property.Value, _context.QueryFilters))
                             as IEnumerable;

                return(enumerable);
            }
            catch (ArgumentException ex)
            {
                throw MissingProperty(property.Name, ex);
            }
        }
        private IEnumerable ApplyProperty(IEnumerable enumerable, FilteringProperty property)
        {
            try
            {
                var elementType = enumerable
                    .GetType()
                    .GetInterface("IEnumerable`1")
                    .GetGenericArguments()
                    .First();

                enumerable = enumerable.ApplyQuery(
                    QueryMethod.Where,
                    Lambda.SelectPropertyValue(elementType, property.Name, property.Value, _context.QueryFilters))
                    as IEnumerable;

                return enumerable;
            }
            catch (ArgumentException ex)
            {
                throw MissingProperty(property.Name, ex);
            }
        }