Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CsdlAction"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="returnType">The return type of the function.</param>
 /// <param name="isBound">if set to <c>true</c> [is bound].</param>
 /// <param name="entitySetPath">The entity set path.</param>
 /// <param name="location">The location in the csdl document of the function.</param>
 public CsdlAction(
     string name,
     IEnumerable <CsdlOperationParameter> parameters,
     CsdlTypeReference returnType,
     bool isBound,
     string entitySetPath,
     CsdlLocation location)
     : base(name, parameters, returnType, isBound, entitySetPath, location)
 {
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CsdlAction"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="returnType">The return type of the function.</param>
 /// <param name="isBound">if set to <c>true</c> [is bound].</param>
 /// <param name="entitySetPath">The entity set path.</param>
 /// <param name="documentation">The documentation.</param>
 /// <param name="location">The location in the csdl document of the function.</param>
 public CsdlAction(
     string name, 
     IEnumerable<CsdlOperationParameter> parameters, 
     CsdlTypeReference returnType, 
     bool isBound, 
     string entitySetPath, 
     CsdlDocumentation documentation, 
     CsdlLocation location)
     : base(name, parameters, returnType, isBound, entitySetPath, documentation, location)
 {
 }
Ejemplo n.º 3
0
 protected CsdlOperationImport(
     string name,
     string schemaOperationQualifiedTypeName,
     string entitySet,
     IEnumerable <CsdlOperationParameter> parameters,
     CsdlTypeReference returnType,
     CsdlLocation location)
     : base(name, parameters, returnType, location)
 {
     this.entitySet = entitySet;
     this.SchemaOperationQualifiedTypeName = schemaOperationQualifiedTypeName;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CsdlAction"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="returnType">Type of the return.</param>
 /// <param name="isBound">if set to <c>true</c> [is bound].</param>
 /// <param name="entitySetPath">The entity set path.</param>
 /// <param name="location">The location.</param>
 public CsdlOperation(
     string name,
     IEnumerable <CsdlOperationParameter> parameters,
     CsdlTypeReference returnType,
     bool isBound,
     string entitySetPath,
     CsdlLocation location)
     : base(name, parameters, returnType, location)
 {
     this.IsBound       = isBound;
     this.EntitySetPath = entitySetPath;
 }
Ejemplo n.º 5
0
 protected CsdlOperationImport(
     string name,
     string schemaOperationQualifiedTypeName,
     string entitySet,
     IEnumerable<CsdlOperationParameter> parameters,
     CsdlTypeReference returnType,
     CsdlDocumentation documentation,
     CsdlLocation location)
     : base(name, parameters, returnType, documentation, location)
 {
     this.entitySet = entitySet;
     this.SchemaOperationQualifiedTypeName = schemaOperationQualifiedTypeName;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CsdlFunction"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="returnType">The return type of the function.</param>
 /// <param name="isBound">if set to <c>true</c> [is bound].</param>
 /// <param name="entitySetPath">The entity set path.</param>
 /// <param name="isComposable">if set to <c>true</c> [is composable].</param>
 /// <param name="documentation">The documentation.</param>
 /// <param name="location">The location in the csdl document of the function.</param>
 public CsdlFunction(
     string name,
     IEnumerable <CsdlOperationParameter> parameters,
     CsdlTypeReference returnType,
     bool isBound,
     string entitySetPath,
     bool isComposable,
     CsdlDocumentation documentation,
     CsdlLocation location)
     : base(name, parameters, returnType, isBound, entitySetPath, documentation, location)
 {
     this.IsComposable = isComposable;
 }
Ejemplo n.º 7
0
 public CsdlOperationReturnType(CsdlTypeReference returnType, CsdlLocation location)
     : base(location)
 {
     this.returnType = returnType;
 }
Ejemplo n.º 8
0
 public CsdlRecordExpression(CsdlTypeReference type, IEnumerable <CsdlPropertyValue> propertyValues, CsdlLocation location)
     : base(location)
 {
     this.type           = type;
     this.propertyValues = new List <CsdlPropertyValue>(propertyValues);
 }
Ejemplo n.º 9
0
        internal static CsdlFunction Function(
            string name, 
            CsdlOperationParameter[] parameters = default(CsdlOperationParameter[]), 
            CsdlTypeReference typeReference = null, 
            bool isBound = false, 
            string entitySetPath = null, 
            bool isComposable = false,
            CsdlDocumentation documentation = null, 
            CsdlLocation location = null)
        {
            if (parameters == null)
            {
                parameters = new CsdlOperationParameter[] { };
            }

            return new CsdlFunction(
                name,
                parameters,
                typeReference,
                isBound,
                entitySetPath,
                isComposable,
                documentation,
                location);
        }
Ejemplo n.º 10
0
 protected CsdlFunctionBase(string name, IEnumerable <CsdlOperationParameter> parameters, CsdlTypeReference returnType, CsdlDocumentation documentation, CsdlLocation location)
     : base(name, documentation, location)
 {
     this.parameters = new List <CsdlOperationParameter>(parameters);
     this.returnType = returnType;
 }
 public CsdlCollectionExpression(CsdlTypeReference type, IEnumerable <CsdlExpressionBase> elementValues, CsdlLocation location)
     : base(location)
 {
     this.type          = type;
     this.elementValues = new List <CsdlExpressionBase>(elementValues);
 }
Ejemplo n.º 12
0
 protected CsdlFunctionBase(string name, IEnumerable<CsdlOperationParameter> parameters, CsdlTypeReference returnType, CsdlDocumentation documentation, CsdlLocation location)
     : base(name, documentation, location)
 {
     this.parameters = new List<CsdlOperationParameter>(parameters);
     this.returnType = returnType;
 }
Ejemplo n.º 13
0
        internal static IEdmTypeReference WrapTypeReference(CsdlSemanticsSchema schema, CsdlTypeReference type)
        {
            var typeReference = type as CsdlNamedTypeReference;
            if (typeReference != null)
            {
                var primitiveReference = typeReference as CsdlPrimitiveTypeReference;
                if (primitiveReference != null)
                {
                    switch (primitiveReference.Kind)
                    {
                        case EdmPrimitiveTypeKind.Boolean:
                        case EdmPrimitiveTypeKind.Byte:
                        case EdmPrimitiveTypeKind.Date:
                        case EdmPrimitiveTypeKind.Double:
                        case EdmPrimitiveTypeKind.Guid:
                        case EdmPrimitiveTypeKind.Int16:
                        case EdmPrimitiveTypeKind.Int32:
                        case EdmPrimitiveTypeKind.Int64:
                        case EdmPrimitiveTypeKind.SByte:
                        case EdmPrimitiveTypeKind.Single:
                        case EdmPrimitiveTypeKind.Stream:
                            return new CsdlSemanticsPrimitiveTypeReference(schema, primitiveReference);

                        case EdmPrimitiveTypeKind.Binary:
                            return new CsdlSemanticsBinaryTypeReference(schema, (CsdlBinaryTypeReference)primitiveReference);

                        case EdmPrimitiveTypeKind.DateTimeOffset:
                        case EdmPrimitiveTypeKind.Duration:
                        case EdmPrimitiveTypeKind.TimeOfDay:
                            return new CsdlSemanticsTemporalTypeReference(schema, (CsdlTemporalTypeReference)primitiveReference);

                        case EdmPrimitiveTypeKind.Decimal:
                            return new CsdlSemanticsDecimalTypeReference(schema, (CsdlDecimalTypeReference)primitiveReference);

                        case EdmPrimitiveTypeKind.String:
                            return new CsdlSemanticsStringTypeReference(schema, (CsdlStringTypeReference)primitiveReference);

                        case EdmPrimitiveTypeKind.Geography:
                        case EdmPrimitiveTypeKind.GeographyPoint:
                        case EdmPrimitiveTypeKind.GeographyLineString:
                        case EdmPrimitiveTypeKind.GeographyPolygon:
                        case EdmPrimitiveTypeKind.GeographyCollection:
                        case EdmPrimitiveTypeKind.GeographyMultiPolygon:
                        case EdmPrimitiveTypeKind.GeographyMultiLineString:
                        case EdmPrimitiveTypeKind.GeographyMultiPoint:
                        case EdmPrimitiveTypeKind.Geometry:
                        case EdmPrimitiveTypeKind.GeometryPoint:
                        case EdmPrimitiveTypeKind.GeometryLineString:
                        case EdmPrimitiveTypeKind.GeometryPolygon:
                        case EdmPrimitiveTypeKind.GeometryCollection:
                        case EdmPrimitiveTypeKind.GeometryMultiPolygon:
                        case EdmPrimitiveTypeKind.GeometryMultiLineString:
                        case EdmPrimitiveTypeKind.GeometryMultiPoint:
                            return new CsdlSemanticsSpatialTypeReference(schema, (CsdlSpatialTypeReference)primitiveReference);
                    }
                }

                return new CsdlSemanticsNamedTypeReference(schema, typeReference);
            }

            var typeExpression = type as CsdlExpressionTypeReference;
            if (typeExpression != null)
            {
                var collectionType = typeExpression.TypeExpression as CsdlCollectionType;
                if (collectionType != null)
                {
                    return new CsdlSemanticsCollectionTypeExpression(typeExpression, new CsdlSemanticsCollectionTypeDefinition(schema, collectionType));
                }

                var entityReferenceType = typeExpression.TypeExpression as CsdlEntityReferenceType;
                if (entityReferenceType != null)
                {
                    return new CsdlSemanticsEntityReferenceTypeExpression(typeExpression, new CsdlSemanticsEntityReferenceTypeDefinition(schema, entityReferenceType));
                }
            }

            return null;
        }
Ejemplo n.º 14
0
 public CsdlCollectionExpression(CsdlTypeReference type, IEnumerable<CsdlExpressionBase> elementValues, CsdlLocation location)
     : base(location)
 {
     this.type = type;
     this.elementValues = new List<CsdlExpressionBase>(elementValues);
 }
Ejemplo n.º 15
0
 public CsdlRecordExpression(CsdlTypeReference type, IEnumerable<CsdlPropertyValue> propertyValues, CsdlLocation location)
     : base(location)
 {
     this.type = type;
     this.propertyValues = new List<CsdlPropertyValue>(propertyValues);
 }