Esempio n. 1
0
 internal override void Validate()
 {
     base.Validate();
     ValidationHelper.ValidateTypeDeclaration((SchemaElement)this, this._type, (SchemaElement)this._typeSubElement);
     ValidationHelper.ValidateFacets((SchemaElement)this, this._type, this._typeUsageBuilder);
     if (this._isRefType)
     {
         ValidationHelper.ValidateRefType((SchemaElement)this, this._type);
     }
     if (this.Schema.DataModel != SchemaDataModelOption.EntityDataModel)
     {
         if (this.Schema.DataModel == SchemaDataModelOption.ProviderManifestModel)
         {
             if (this._type != null && (!(this._type is ScalarType) || this._collectionKind != CollectionKind.None) || this._typeSubElement != null && !(this._typeSubElement.Type is ScalarType))
             {
                 string str = "";
                 if (this._type != null)
                 {
                     str = Function.GetTypeNameForErrorMessage(this._type, this._collectionKind, this._isRefType);
                 }
                 else if (this._typeSubElement != null)
                 {
                     str = this._typeSubElement.FQName;
                 }
                 this.AddError(ErrorCode.FunctionWithNonEdmTypeNotSupported, EdmSchemaErrorSeverity.Error, (SchemaElement)this, (object)Strings.FunctionWithNonEdmPrimitiveTypeNotSupported((object)str, (object)this.ParentElement.FQName));
             }
         }
         else if (this._type != null)
         {
             if (!(this._type is ScalarType) || this._collectionKind != CollectionKind.None)
             {
                 this.AddError(ErrorCode.FunctionWithNonPrimitiveTypeNotSupported, EdmSchemaErrorSeverity.Error, (SchemaElement)this, (object)Strings.FunctionWithNonPrimitiveTypeNotSupported(this._isRefType ? (object)this._unresolvedType : (object)this._type.FQName, (object)this.ParentElement.FQName));
             }
         }
         else if (this._typeSubElement != null && !(this._typeSubElement.Type is ScalarType))
         {
             if (this.Schema.SchemaVersion < 3.0)
             {
                 this.AddError(ErrorCode.FunctionWithNonPrimitiveTypeNotSupported, EdmSchemaErrorSeverity.Error, (SchemaElement)this, (object)Strings.FunctionWithNonPrimitiveTypeNotSupported((object)this._typeSubElement.FQName, (object)this.ParentElement.FQName));
             }
             else
             {
                 CollectionTypeElement typeSubElement = this._typeSubElement as CollectionTypeElement;
                 if (typeSubElement != null)
                 {
                     RowTypeElement subElement = typeSubElement.SubElement as RowTypeElement;
                     if (subElement != null && subElement.Properties.Any <RowTypePropertyElement>((Func <RowTypePropertyElement, bool>)(p => !p.ValidateIsScalar())))
                     {
                         this.AddError(ErrorCode.TVFReturnTypeRowHasNonScalarProperty, EdmSchemaErrorSeverity.Error, (SchemaElement)this, (object)Strings.TVFReturnTypeRowHasNonScalarProperty);
                     }
                 }
             }
         }
     }
     if (this._typeSubElement == null)
     {
         return;
     }
     this._typeSubElement.Validate();
 }
Esempio n. 2
0
        protected void HandleCollectionTypeElement(XmlReader reader)
        {
            CollectionTypeElement collectionTypeElement = new CollectionTypeElement((SchemaElement)this);

            collectionTypeElement.Parse(reader);
            this._typeSubElement = (ModelFunctionTypeElement)collectionTypeElement;
        }
Esempio n. 3
0
        protected void HandleCollectionTypeElement(XmlReader reader)
        {
            DebugCheck.NotNull(reader);

            var subElement = new CollectionTypeElement(this);

            subElement.Parse(reader);
            _typeSubElement = subElement;
        }
        protected void HandleCollectionTypeElement(XmlReader reader)
        {
            DebugCheck.NotNull(reader);

            var subElement = new CollectionTypeElement(this);
            subElement.Parse(reader);
            _typeSubElement = subElement;
        }