예제 #1
0
        public IEnumerable <Scalar> GetArgsExpression(Dictionary <string, object> parameters)
        {
            if (placeholderNameToPosition == null || placeholderNameToPosition.Count == 0)
            {
                throw new ArgumentException(ResourcesX.NoPlaceholders);
            }

            Scalar[] paramsList = new Scalar[placeholderNameToPosition.Count];
            foreach (var param in parameters)
            {
                if (!placeholderNameToPosition.ContainsKey(param.Key.ToLowerInvariant()))
                {
                    throw new ArgumentNullException(string.Format(ResourcesX.UnknownPlaceholder, param.Key));
                }
                paramsList[placeholderNameToPosition[param.Key.ToLowerInvariant()]] = ExprUtil.ArgObjectToScalar(param.Value)
                                                                                      ?? throw new ArgumentException(param.Key);
            }
            return(paramsList);
        }