/// <summary> /// 根据条件对象生成WhereSqlClauseBuilder /// </summary> /// <param name="condition"></param> /// <param name="ignoreDefaultValue"></param> /// <param name="acv"></param> /// <param name="ignoreProperties">需要忽略的属性</param> /// <returns></returns> public static WhereSqlClauseBuilder GetWhereSqlClauseBuilder( object condition, bool ignoreDefaultValue, AdjustConditionValueDelegate acv, params string[] ignoreProperties) { ExceptionHelper.FalseThrow <ArgumentNullException>(condition != null, "condition"); ConditionMappingItemCollection mapping = GetMappingInfo(condition.GetType()); return(GetWhereSqlClauseBuilderFromMapping(condition, mapping.FilterByType <ConditionMappingItem>(), ignoreDefaultValue, acv, ignoreProperties)); }
private static ConnectiveSqlClauseCollection GetConnectiveSqlClauseBuilderFromMapping( object condition, ConditionMappingItemCollection mapping, bool ignoreDefaultValue, AdjustConditionValueDelegate acv, string[] ignoreProperties) { ConnectiveSqlClauseCollection connectiveBuilder = new ConnectiveSqlClauseCollection(); WhereSqlClauseBuilder whereBuilder = GetWhereSqlClauseBuilderFromMapping(condition, mapping.FilterByType <ConditionMappingItem>(), ignoreDefaultValue, acv, ignoreProperties); connectiveBuilder.Add(whereBuilder); FillInSqlClauseBuilderFromMapping(connectiveBuilder, condition, mapping.FilterByType <InConditionMappingItem>(), ignoreDefaultValue, acv, ignoreProperties); return(connectiveBuilder); }