public static SqlFunctionCallScalarExpression Create(
            string name,
            bool isUdf,
            ImmutableArray <SqlScalarExpression> arguments)
        {
            if (!SqlFunctionCallScalarExpression.FunctionIdentifiers.TryGetValue(name, out SqlIdentifier sqlIdentifier))
            {
                sqlIdentifier = SqlIdentifier.Create(name);
            }

            return(SqlFunctionCallScalarExpression.Create(sqlIdentifier, isUdf, arguments));
        }
        private SqlFunctionCallScalarExpression(
            SqlIdentifier name,
            bool isUdf,
            ImmutableArray <SqlScalarExpression> arguments)
        {
            foreach (SqlScalarExpression argument in arguments)
            {
                if (argument == null)
                {
                    throw new ArgumentNullException($"{nameof(arguments)} must not have null items.");
                }
            }

            this.Arguments = arguments;
            this.Name      = name ?? throw new ArgumentNullException(nameof(name));
            this.IsUdf     = isUdf;
        }
        private SqlFunctionCallScalarExpression(
            SqlIdentifier name,
            bool isUdf,
            IReadOnlyList <SqlScalarExpression> arguments)
        {
            if (arguments == null)
            {
                throw new ArgumentNullException($"{nameof(arguments)} must not be null.");
            }

            foreach (SqlScalarExpression argument in arguments)
            {
                if (argument == null)
                {
                    throw new ArgumentNullException($"{nameof(arguments)} must not have null items.");
                }
            }

            this.Arguments = new List <SqlScalarExpression>(arguments);
            this.Name      = name ?? throw new ArgumentNullException(nameof(name));
            this.IsUdf     = isUdf;
        }
Beispiel #4
0
 public static SqlArrayIteratorCollectionExpression Create(
     SqlIdentifier identifier,
     SqlCollection collection) => new SqlArrayIteratorCollectionExpression(identifier, collection);
 public static SqlFunctionCallScalarExpression CreateBuiltin(
     SqlIdentifier name,
     ImmutableArray <SqlScalarExpression> arguments) => SqlFunctionCallScalarExpression.Create(name, isUdf: false, arguments);
 public static SqlFunctionCallScalarExpression CreateBuiltin(
     SqlIdentifier name,
     params SqlScalarExpression[] arguments) => SqlFunctionCallScalarExpression.Create(name, isUdf: false, arguments);
 public static SqlFunctionCallScalarExpression Create(
     SqlIdentifier name,
     bool isUdf,
     ImmutableArray <SqlScalarExpression> arguments) => new SqlFunctionCallScalarExpression(name, isUdf, arguments);
 public static SqlFunctionCallScalarExpression Create(
     SqlIdentifier name,
     bool isUdf,
     params SqlScalarExpression[] arguments) => new SqlFunctionCallScalarExpression(name, isUdf, arguments.ToImmutableArray());
 public static SqlPropertyRefScalarExpression Create(
     SqlScalarExpression member,
     SqlIdentifier identifier) => new SqlPropertyRefScalarExpression(member, identifier);
Beispiel #10
0
 public static SqlAliasedCollectionExpression Create(
     SqlCollection collection,
     SqlIdentifier alias)
 {
     return(new SqlAliasedCollectionExpression(collection, alias));
 }
 public static SqlFunctionCallScalarExpression CreateBuiltin(
     SqlIdentifier name,
     IReadOnlyList <SqlScalarExpression> arguments) => SqlFunctionCallScalarExpression.Create(name, false, arguments);
 public static SqlFunctionCallScalarExpression Create(
     SqlIdentifier name,
     bool isUdf,
     IReadOnlyList <SqlScalarExpression> arguments) => new SqlFunctionCallScalarExpression(name, isUdf, arguments);
 public static SqlIdentifierPathExpression Create(
     SqlPathExpression parentPath,
     SqlIdentifier value) => new SqlIdentifierPathExpression(parentPath, value);
 private SqlIdentifierPathExpression(SqlPathExpression parentPath, SqlIdentifier value)
     : base(parentPath)
 {
     this.Value = value ?? throw new ArgumentNullException(nameof(value));
 }
Beispiel #15
0
 public static SqlSelectItem Create(
     SqlScalarExpression expression,
     SqlIdentifier alias = null)
 {
     return(new SqlSelectItem(expression, alias));
 }
 public static SqlInputPathCollection Create(
     SqlIdentifier input,
     SqlPathExpression relativePath) => new SqlInputPathCollection(input, relativePath);