System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CheckType(System.Data.Metadata.Edm.TypeUsage, string)

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

6 Examples 7

1. Example

View license
internal static void ValidateNull(TypeUsage nullType)
        {
            CheckType(nullType, "nullType");
        }

2. Example

View license
internal static TypeUsage ValidateNewEmptyCollection(TypeUsage collectionType, out DbExpressionList validElements)
        {
            CheckType(collectionType, "collectionType");
            if (!TypeSemantics.IsCollectionType(collectionType))
            {
                throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_NewInstance_CollectionTypeRequired, "collectionType");
            }

            // 





            validElements = new DbExpressionList(new DbExpression[] { });
            return collectionType;
        }

3. Example

View license
private static void CheckType(TypeUsage type)
        {
            CheckType(type, "type");
        }

4. Example

View license
private static void ValidateTypeUnary(DbExpression argument, TypeUsage type, string typeArgumentName)
        {
            ValidateUnary(argument);
            CheckType(type, typeArgumentName);
        }

5. Example

View license
internal static void ValidateConstant(TypeUsage constantType, object value)
        {
            ///n ..... /n //View Source file for more details /n }

6. Example

View license
internal static TypeUsage ValidateNew(TypeUsage instanceType, IEnumerable<DbExpression> arguments, out DbExpressionList validArguments)
        {
            //
            // Ensure that the type is non-null, valid and not NullType
            //
            CheckType(instanceType, "instanceType");

            CollectionType collectionType = null;
            if (TypeHelpers.TryGetEdmType<CollectionType>(instanceType, out collectionType) &&
                collectionType != null)
            {
                // Collection arguments may have zero count for empty collection construction
                TypeUsage elementType = collectionType.TypeUsage;
                validArguments = CreateExpressionList(arguments, "arguments", true, (exp, idx) =>
                    {
                        RequireCompatibleType(exp, elementType, "arguments", idx);
                    });
            }
            else
            {
                List<TypeUsage> expectedTypes = GetStructuralMemberTypes(instanceType);
                int pos = 0;
                validArguments = CreateExpressionList(arguments, "arguments", expectedTypes.Count, (exp, idx) =>
                    {
                        RequireCompatibleType(exp, expectedTypes[pos++], "arguments", idx);
                    });
            }

            return instanceType;
        }