System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.RequireCollectionArguments(System.Data.Common.CommandTrees.DbExpression, System.Data.Common.CommandTrees.DbExpression)

Here are the examples of the csharp api class System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.RequireCollectionArguments(System.Data.Common.CommandTrees.DbExpression, System.Data.Common.CommandTrees.DbExpression) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

View license
private static TypeUsage RequireComparableCollectionArguments<TExpressionType>(DbExpression left, DbExpression right)
        {
            TypeUsage resultType = RequireCollectionArguments<TExpressionType>(left, right);

            if (!TypeHelpers.IsSetComparableOpType(TypeHelpers.GetElementTypeUsage(left.ResultType)))
            {
                throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_InvalidTypeForSetOperation(TypeHelpers.GetElementTypeUsage(left.ResultType).Identity, typeof(TExpressionType).Name), "left");
            }

            if (!TypeHelpers.IsSetComparableOpType(TypeHelpers.GetElementTypeUsage(right.ResultType)))
            {
                throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_InvalidTypeForSetOperation(TypeHelpers.GetElementTypeUsage(right.ResultType).Identity, typeof(TExpressionType).Name), "right");
            }

            return resultType;
        }

2. Example

View license
internal static TypeUsage ValidateUnionAll(DbExpression left, DbExpression right)
        {
            ValidateBinary(left, right);

            //
            // Ensure that the left and right operands are each of a collection type and that a common type exists for those types.
            //
            return RequireCollectionArguments<DbUnionAllExpression>(left, right);
        }