Пример #1
0
        public static Type GetClrType(this IEdmModel edmModel, IEdmEntitySetBase entitySet)
        {
            IEdmEntityType           entityType        = entitySet.EntityType();
            OeValueAnnotation <Type> clrTypeAnnotation = edmModel.GetAnnotationValue <OeValueAnnotation <Type> >(entityType);

            return(clrTypeAnnotation.Value);
        }
        public static Type GetClrType(this IEdmModel edmModel, IEdmType edmType)
        {
            if (edmType.TypeKind == EdmTypeKind.Primitive)
            {
                return(PrimitiveTypeHelper.GetClrType((edmType as IEdmPrimitiveType).PrimitiveKind));
            }

            OeValueAnnotation <Type> clrTypeAnnotation = edmModel.GetAnnotationValue <OeValueAnnotation <Type> >(edmType);

            if (clrTypeAnnotation != null)
            {
                return(clrTypeAnnotation.Value);
            }

            if (edmType is IEdmCollectionType collectionType)
            {
                return(edmModel.GetClrType(collectionType.ElementType.Definition));
            }

            throw new InvalidOperationException("Add type annotation for " + edmType.FullTypeName());
        }
        public static bool IsDbFunction(this IEdmModel edmModel, IEdmOperation edmOperation)
        {
            OeValueAnnotation <bool> valueAnnotation = edmModel.GetAnnotationValue <OeValueAnnotation <bool> >(edmOperation);

            return(valueAnnotation.Value);
        }