/// <summary> /// Set recurve criteria /// </summary> /// <param name="key">Key</param> /// <param name="relationKey">Relation key</param> /// <param name="direction">Recurve direction</param> /// <returns>Return the newest IQuery object</returns> public IQuery SetRecurve(string key, string relationKey, RecurveDirection direction = RecurveDirection.Down) { if (string.IsNullOrWhiteSpace(key) || string.IsNullOrWhiteSpace(relationKey)) { throw new EZNEWException($"{nameof(key)} or {nameof(relationKey)} is null or empty"); } if (key == relationKey) { throw new EZNEWException($"{nameof(key)} and {nameof(relationKey)} can not be the same value"); } RecurveCriteria = new RecurveCriteria() { Key = key, RelationKey = relationKey, Direction = direction }; hasRecurveCriteria = true; return(this); }
/// <summary> /// Set recurve criteria /// </summary> /// <typeparam name="TQueryModel">Query model</typeparam> /// <param name="key">Key</param> /// <param name="relationKey">Relation key</param> /// <param name="direction">Recurve direction</param> /// <returns>Return the newest IQuery object</returns> public IQuery SetRecurve <TQueryModel>(Expression <Func <TQueryModel, dynamic> > key, Expression <Func <TQueryModel, dynamic> > relationKey, RecurveDirection direction = RecurveDirection.Down) where TQueryModel : IQueryModel <TQueryModel> { return(SetRecurve(ExpressionHelper.GetExpressionPropertyName(key), ExpressionHelper.GetExpressionPropertyName(relationKey), direction)); }