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
0
1. Example
View licenseinternal static void ValidateNull(TypeUsage nullType) { CheckType(nullType, "nullType"); }
0
2. Example
View licenseinternal 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; }
0
0
4. Example
View licenseprivate static void ValidateTypeUnary(DbExpression argument, TypeUsage type, string typeArgumentName) { ValidateUnary(argument); CheckType(type, typeArgumentName); }
0
5. Example
View licenseinternal static void ValidateConstant(TypeUsage constantType, object value) { ///n ..... /n //View Source file for more details /n }
0
6. Example
View licenseinternal 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; }