Example #1
0
        public IEdmLabeledExpression WrapLabeledElement(CsdlLabeledExpression labeledElement, IEdmEntityType bindingContext)
        {
            IEdmLabeledExpression expression;

            if (!this.semanticsLabeledElements.TryGetValue(labeledElement, out expression))
            {
                expression = new CsdlSemanticsLabeledExpression(labeledElement.Label, labeledElement.Element, bindingContext, this);
                this.semanticsLabeledElements[labeledElement] = expression;
            }
            return(expression);
        }
Example #2
0
        public IEdmLabeledExpression WrapLabeledElement(CsdlLabeledExpression labeledElement, IEdmEntityType bindingContext)
        {
            IEdmLabeledExpression result;

            // Guarantee that multiple requests to wrap a given labeled element all return the same object.
            if (!this.semanticsLabeledElements.TryGetValue(labeledElement, out result))
            {
                result = new CsdlSemanticsLabeledExpression(labeledElement.Label, labeledElement.Element, bindingContext, this);
                this.semanticsLabeledElements[labeledElement] = result;
            }

            return(result);
        }