Example #1
0
        private ParameterContext GetParameterContext(ParameterContext parameterContext, List <string> parameterNames)
        {
            if (0 == _parametersCount)
            {
                return(new ParameterContext(0));
            }
            var result = new ParameterContext(_parametersCount);

            foreach (var parameterName in parameterNames)
            {
                if (!parameterContext.TryGetDbParameter(parameterName, out var dbParameter))
                {
                    throw new ShardingException($"parameter name:[{parameterName}] not found in parameters");
                }

                result.AddParameter(dbParameter);
            }
            return(result);
        }