Пример #1
0
        private ParameterContext GetParameterContext(IParameterBuilder parameterBuilder, RouteResult routeResult, RouteUnit routeUnit)
        {
            if (parameterBuilder is StandardParameterBuilder || routeResult.GetOriginalDataNodes().IsEmpty() || parameterBuilder.GetParameterContext().IsEmpty())
            {
                return(parameterBuilder.GetParameterContext());
            }
            var result = new ParameterContext();
            int count  = 0;

            foreach (var originalDataNode in routeResult.GetOriginalDataNodes())
            {
                if (IsInSameDataNode(originalDataNode, routeUnit))
                {
                    result.AddParameters(((GroupedParameterBuilder)parameterBuilder).GetParameterContext(count).GetDbParameters());
                }
                count++;
            }
            return(result);
        }
        private RouteResult GenerateRouteResult(ICollection <DataNode> routedDataNodes)
        {
            RouteResult result = new RouteResult();

            result.GetOriginalDataNodes().AddAll(OriginalDataNodes);
            foreach (var routedDataNode in routedDataNodes)
            {
                result.GetRouteUnits().Add(
                    new RouteUnit(new RouteMapper(routedDataNode.GetDataSourceName(), routedDataNode.GetDataSourceName()), new List <RouteMapper>()
                {
                    new RouteMapper(LogicTableName, routedDataNode.GetTableName())
                }));
            }
            return(result);
        }