It seems that this methods are required if you are going to build Linq sentences on the fly passing a parameter BUT I ask this:
If I have a cascading of 5 or more levels carried on by PKs which I have already added to my Metedata file (I have added more Cascade ditectives in my base class, up to seven levels)
How can I rewrite all this methods in order to achieve proper cascading from level 3 on (I have obviously added the logig for the firts 2, which was a little easier)???????
Topolov
Member
680 Points
411 Posts
About LinqExpressionHelper
Feb 21, 2012 04:33 AM|LINK
The LinqExpressionHelper class goes more or less like this:
public static class LinqExpressionHelper { internal static IQueryable GetQueryFilteredByParent(this IQueryable sourceQuery, MetaForeignKeyColumn fkColumn, String fkSelectedValue) internal static IQueryable GetQueryFilteredByParent1(this IQueryable sourceQuery, MetaForeignKeyColumn fkColumn, String fkSelectedValue, MetaForeignKeyColumn pk1) internal static Expression BuildWhereClause(MetaForeignKeyColumn fkColumn, ParameterExpression parameterExpression, string fkSelectedValue) public static MethodCallExpression BuildSingleItemQuery(IQueryable query, MetaTable metaTable, string[] primaryKeyValues) public static MethodCallExpression BuildItemsQuery(IQueryable query, MetaTable metaTable, IList<MetaColumn> columns, string[] values) public static MethodCallExpression BuildWhereQuery(IQueryable query, MetaTable metaTable, MetaColumn column, string value) public static MethodCallExpression BuildCustomQuery(IQueryable query, MetaTable metaTable, MetaColumn column, string value, QueryType queryType) public static BinaryExpression BuildWhereBody(ParameterExpression parameter, IList<MetaColumn> columns, string[] values) private static BinaryExpression BuildWhereBodyFragment(ParameterExpression parameter, MetaColumn column, string value) private static object ChangeValueType(MetaColumn column, string value) public static Expression GetValue(Expression exp) private static Type RemoveNullableFromType(Type type) public static Type GetUnderlyingType(Type type) public static Expression Join(IEnumerable<Expression> expressions, Func<Expression, Expression, Expression> joinFunction) public static Expression CreatePropertyExpression(Expression parameterExpression, string propertyName) private static bool TypeAllowsNull(Type type) internal static object ChangeType(object value, Type type)It seems that this methods are required if you are going to build Linq sentences on the fly passing a parameter BUT I ask this:
If I have a cascading of 5 or more levels carried on by PKs which I have already added to my Metedata file (I have added more Cascade ditectives in my base class, up to seven levels)
How can I rewrite all this methods in order to achieve proper cascading from level 3 on (I have obviously added the logig for the firts 2, which was a little easier)???????