Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EdmEntitySetFacade"/> class.
        /// </summary>
        /// <param name="serverEntitySet">The entity set from the server model.</param>
        /// <param name="containerFacade">The entity container facade to which the set belongs.</param>
        /// <param name="modelFacade">The model facade.</param>
        internal EdmEntitySetFacade(IEdmEntitySet serverEntitySet, EdmEntityContainerFacade containerFacade, EdmModelFacade modelFacade)
        {
            Debug.Assert(serverEntitySet != null, "serverEntitySet != null");
            Debug.Assert(containerFacade != null, "container != null");
            Debug.Assert(modelFacade != null, "modelFacade != null");

            this.serverEntitySet = serverEntitySet;
            this.Container = containerFacade;
            this.modelFacade = modelFacade;
            
            this.Name = this.serverEntitySet.Name;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EdmEntitySetFacade"/> class.
        /// </summary>
        /// <param name="serverEntitySet">The entity set from the server model.</param>
        /// <param name="containerFacade">The entity container facade to which the set belongs.</param>
        /// <param name="modelFacade">The model facade.</param>
        internal EdmEntitySetFacade(IEdmEntitySet serverEntitySet, EdmEntityContainerFacade containerFacade, EdmModelFacade modelFacade)
        {
            Debug.Assert(serverEntitySet != null, "serverEntitySet != null");
            Debug.Assert(containerFacade != null, "container != null");
            Debug.Assert(modelFacade != null, "modelFacade != null");

            this.serverEntitySet = serverEntitySet;
            this.Container       = containerFacade;
            this.modelFacade     = modelFacade;

            this.Name = this.serverEntitySet.Name;
        }
        /// <summary>
        /// Initializes a new instance of <see cref="EdmFunctionImportFacade"/> class.
        /// </summary>
        /// <param name="serverFunctionImport">The function import from the server-side model which we are wrapping.</param>
        /// <param name="containerFacade">The edm container facade this function import belongs to.</param>
        /// <param name="modelFacade">The edm model facade this function import belongs to.</param>
        public EdmFunctionImportFacade(IEdmFunctionImport serverFunctionImport, EdmEntityContainerFacade containerFacade, EdmModelFacade modelFacade)
        {
            Debug.Assert(serverFunctionImport != null, "serverFunctionImport != null");
            Debug.Assert(containerFacade != null, "containerFacade != null");
            Debug.Assert(modelFacade != null, "modelFacade != null");
            this.serverFunctionImport = serverFunctionImport;
            this.containerFacade = containerFacade;

            IEdmTypeReference serverReturnTypeReference = serverFunctionImport.ReturnType;
            if (serverReturnTypeReference == null)
            {
                this.returnType = null;
            }
            else
            {
                IEdmType serverReturnType = modelFacade.GetOrCreateEntityTypeFacadeOrReturnNonEntityServerType(serverReturnTypeReference.Definition);
                this.returnType = serverReturnType.ToEdmTypeReference(serverReturnTypeReference.IsNullable);
            }

            this.parameters = serverFunctionImport.Parameters.Select(p => new EdmFunctionParameterFacade(p, this, modelFacade)).ToArray();
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of <see cref="EdmFunctionImportFacade"/> class.
        /// </summary>
        /// <param name="serverFunctionImport">The function import from the server-side model which we are wrapping.</param>
        /// <param name="containerFacade">The edm container facade this function import belongs to.</param>
        /// <param name="modelFacade">The edm model facade this function import belongs to.</param>
        public EdmFunctionImportFacade(IEdmFunctionImport serverFunctionImport, EdmEntityContainerFacade containerFacade, EdmModelFacade modelFacade)
        {
            Debug.Assert(serverFunctionImport != null, "serverFunctionImport != null");
            Debug.Assert(containerFacade != null, "containerFacade != null");
            Debug.Assert(modelFacade != null, "modelFacade != null");
            this.serverFunctionImport = serverFunctionImport;
            this.containerFacade      = containerFacade;

            IEdmTypeReference serverReturnTypeReference = serverFunctionImport.ReturnType;

            if (serverReturnTypeReference == null)
            {
                this.returnType = null;
            }
            else
            {
                IEdmType serverReturnType = modelFacade.GetOrCreateEntityTypeFacadeOrReturnNonEntityServerType(serverReturnTypeReference.Definition);
                this.returnType = serverReturnType.ToEdmTypeReference(serverReturnTypeReference.IsNullable);
            }

            this.parameters = serverFunctionImport.Parameters.Select(p => new EdmFunctionParameterFacade(p, this, modelFacade)).ToArray();
        }