src/Shared/EntityFramework/Core/Objects/ObjectViewFactory.cs
// <summary>
// Map the supplied TypeUsage to O-Space.
// </summary>
// <param name="typeUsage"> The TypeUsage to be mapped to O-Space. Should either be associated with C-Space or O-Space. </param>
// <param name="objectContext"> ObjectContext used to perform type mapping. </param>
Map the supplied TypeUsage to O-Space.
Map the supplied TypeUsage to O - Space .
private static TypeUsage GetOSpaceTypeUsage(TypeUsage typeUsage, ObjectContext objectContext)
        {
            TypeUsage ospaceTypeUsage;
            if (typeUsage == null
                || typeUsage.EdmType == null)
            {
                ospaceTypeUsage = null;
            }
            else
            {
                if (typeUsage.EdmType.DataSpace
                    == DataSpace.OSpace)
                {
                    ospaceTypeUsage = typeUsage;
                }
                else
                {
                    Debug.Assert(
                        typeUsage.EdmType.DataSpace == DataSpace.CSpace,
                        String.Format(
                            CultureInfo.InvariantCulture, "Expected EdmType.DataSpace to be C-Space, but instead it is {0}.",
                            typeUsage.EdmType.DataSpace.ToString()));
                    if (objectContext == null)
                    {
                        ospaceTypeUsage = null;
                    }
                    else
                    {
                        ospaceTypeUsage = objectContext.Perspective.MetadataWorkspace.GetOSpaceTypeUsage(typeUsage);
                    }
                }
            }
            return ospaceTypeUsage;
        }
private static TypeUsage GetOSpaceTypeUsage ( TypeUsage typeUsage , ObjectContext objectContext ) { TypeUsage ospaceTypeUsage ; if ( typeUsage == null || typeUsage . EdmType == null ) { ospaceTypeUsage = null ; } else { if ( typeUsage . EdmType . DataSpace == DataSpace . OSpace ) { ospaceTypeUsage = typeUsage ; } else { Debug . Assert ( typeUsage . EdmType . DataSpace == DataSpace . CSpace , String . Format ( CultureInfo . InvariantCulture , " " , typeUsage . EdmType . DataSpace . ToString ( ) ) ) ; if ( objectContext == null ) { ospaceTypeUsage = null ; } else { ospaceTypeUsage = objectContext . Perspective . MetadataWorkspace . GetOSpaceTypeUsage ( typeUsage ) ; } } } return ospaceTypeUsage ; }
Map the supplied TypeUsage to O-Space.
Map the supplied TypeUsage to O - Space .
// The ObjectContext is needed to map the EDM TypeUsage from C-Space to O-Space.
typeUsage
TypeUsage
The TypeUsage to be mapped to O-Space. Should either be associated with C-Space or O-Space.
The TypeUsage to be mapped to O - Space . Should either be associated with C - Space or O - Space .
objectContext
ObjectContext
ObjectContext used to perform type mapping.
ObjectContext used to perform type mapping .