Ejemplo n.º 1
0
        internal static TypeUsage ValidateAndConvertTypeUsage(EdmMember edmMember,
                                                              Xml.IXmlLineInfo lineInfo,
                                                              string sourceLocation,
                                                              TypeUsage cspaceType,
                                                              TypeUsage sspaceType,
                                                              List <EdmSchemaError> parsingErrors,
                                                              StoreItemCollection storeItemCollection)
        {
            // if we are already C-Space, dont call the provider. this can happen for functions.
            TypeUsage modelEquivalentSspace = sspaceType;

            if (sspaceType.EdmType.DataSpace == DataSpace.SSpace)
            {
                modelEquivalentSspace = sspaceType.GetModelTypeUsage();
            }

            // check that cspace type is subtype of c-space equivalent type from the ssdl definition
            if (ValidateScalarTypesAreCompatible(cspaceType, modelEquivalentSspace))
            {
                return(modelEquivalentSspace);
            }
            return(null);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns a model (C-Space) typeusage for the given typeusage. if the type is already in c-space, it returns
 /// the given typeusage. The typeUsage returned is created by invoking the provider service to map from provider
 /// specific type to model type.
 /// </summary>
 /// <param name="typeUsage">typeusage</param>
 /// <returns>the respective Model (C-Space) typeusage</returns>
 static internal TypeUsage GetModelTypeUsage(TypeUsage typeUsage)
 {
     return(typeUsage.GetModelTypeUsage());
 }