Example #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="parentElement"></param>
 internal Parameter(Function parentElement)
     : base(parentElement)
 {
     _typeUsageBuilder = new TypeUsageBuilder(this);
 }
Example #2
0
        protected void CloneSetFunctionFields(Function clone)
        {
            clone._isAggregate = _isAggregate;
            clone._isBuiltIn = _isBuiltIn;
            clone._isNiladicFunction = _isNiladicFunction;
            clone._isComposable = _isComposable;
            clone._commandText = _commandText;
            clone._storeFunctionName = _storeFunctionName;
            clone._type = _type;
            clone._returnTypeList = _returnTypeList;
            clone._returnTypeCollectionKind = _returnTypeCollectionKind;
            clone._parameterTypeSemantics = _parameterTypeSemantics;
            clone._schema = _schema;
            clone.Name = Name;

            // Clone all the parameters
            foreach (var parameter in Parameters)
            {
                var error = clone.Parameters.TryAdd((Parameter)parameter.Clone(clone));
                Debug.Assert(error == AddErrorKind.Succeeded, "Since we are cloning a validated function, this should never fail.");
            }
        }
Example #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="parentElement"></param>
 internal ReturnType(Function parentElement)
     : base(parentElement)
 {
     _typeUsageBuilder = new TypeUsageBuilder(this);
 }
Example #4
0
        protected void AddFunctionType(Function function)
        {
            var space = DataModel == SchemaDataModelOption.EntityDataModel ? "Conceptual" : "Storage";

            if (SchemaVersion >= XmlConstants.EdmVersionForV2
                && SchemaManager.SchemaTypes.ContainsKey(function.FQName))
            {
                function.AddError(
                    ErrorCode.AlreadyDefined, EdmSchemaErrorSeverity.Error,
                    Strings.AmbiguousFunctionAndType(function.FQName, space));
            }
            else
            {
                var error = SchemaManager.SchemaTypes.TryAdd(function);
                Debug.Assert(error != AddErrorKind.MissingNameError, "Function identity can never be null while adding global functions");

                if (error != AddErrorKind.Succeeded)
                {
                    function.AddError(
                        ErrorCode.AlreadyDefined, EdmSchemaErrorSeverity.Error,
                        Strings.AmbiguousFunctionOverload(function.FQName, space));
                }
                else
                {
                    SchemaTypes.Add(function);
                }
            }
        }
Example #5
0
        /// <summary>
        /// Handler for the Function element
        /// </summary>
        /// <param name="reader">xml reader currently positioned at EntityType element</param>
        private void HandleFunctionElement(XmlReader reader)
        {
            Debug.Assert(reader != null);

            var function = new Function(this);

            function.Parse(reader);

            Functions.Add(function);
        }
 /// <summary>
 /// Constructs an FunctionCommandText
 /// </summary>
 /// <param name="parentElement">Reference to the schema element.</param>
 public FunctionCommandText(Function parentElement)
     : base(parentElement)
 {
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="parentElement"></param>
 internal FacetEnabledSchemaElement(Function parentElement)
     : base(parentElement)
 {
 }