public ParameterContext GetParameterContext() { var result = new ParameterContext(); for (int i = 0; i < _parameterBuilders.Count; i++) { var dbParameters = GetParameterContext(i).GetDbParameters(); result.AddParameters(dbParameters); } if (_onDuplicateKeyUpdateAddedParameters.GetParameterCount() > 0) { var dbParameters = _onDuplicateKeyUpdateAddedParameters.GetDbParameters(); result.AddParameters(dbParameters); } return(result); }
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); }