Esempio n. 1
0
 internal JoinPart(JoinType joinType, ObjectName tableName, SqlExpression onExpression)
     : this(joinType, tableName, null, onExpression)
 {
     if (ObjectName.IsNullOrEmpty(tableName))
     {
         throw new ArgumentNullException(nameof(tableName));
     }
 }
 public SqlQueryExpressionSource(ObjectName tableName, string alias)
     : this(tableName, null, alias)
 {
     if (ObjectName.IsNullOrEmpty(tableName))
     {
         throw new ArgumentException(nameof(tableName));
     }
 }
Esempio n. 3
0
        internal SqlFunctionExpression(ObjectName functionName, InvokeArgument[] arguments)
            : base(SqlExpressionType.Function)
        {
            if (ObjectName.IsNullOrEmpty(functionName))
            {
                throw new ArgumentNullException(nameof(functionName));
            }

            if (arguments == null)
            {
                arguments = new InvokeArgument[0];
            }

            FunctionName = functionName;
            Arguments    = arguments;
        }
Esempio n. 4
0
        /// <summary>
        /// Constructs an instance of <see cref="Invoke"/> to the given method and
        /// a given list of arguments.
        /// </summary>
        /// <param name="methodName">The name of the method to invoke</param>
        /// <param name="args">The list of arguments of the invoke</param>
        /// <exception cref="ArgumentNullException">If the provided <paramref name="methodName"/>
        /// is <c>null</c> or empty.</exception>
        public Invoke(ObjectName methodName, InvokeArgument[] args)
        {
            if (ObjectName.IsNullOrEmpty(methodName))
            {
                throw new ArgumentNullException(nameof(methodName));
            }

            MethodName = methodName;
            Arguments  = new ArgumentList(this);

            if (args != null)
            {
                foreach (var arg in args)
                {
                    Arguments.Add(arg);
                }
            }
        }
Esempio n. 5
0
        public Grant(string granter, string grantee, ObjectName objectName, Privilege privileges, bool withOption)
        {
            if (ObjectName.IsNullOrEmpty(objectName))
            {
                throw new ArgumentException("The name of the object is empty and invalid", nameof(objectName));
            }
            if (privileges.IsNone)
            {
                throw new ArgumentException("Cannot set the empty privileges to a grant", nameof(privileges));
            }
            if (String.IsNullOrEmpty(granter))
            {
                throw new ArgumentException("The granter of a grant must be known", nameof(granter));
            }

            Granter    = granter;
            Grantee    = grantee;
            ObjectName = objectName;
            Privileges = privileges;
            WithOption = withOption;
        }