예제 #1
0
        /// <summary>
        /// Get the client CLR type according to the qualified type name.
        /// </summary>
        /// <param name="context">The data service context.</param>
        /// <param name="qualifiedTypeName">The qualified type name.</param>
        /// <returns>The client CLR type.</returns>
        private static Type ResolveTypeFromName(DataServiceContext context, string qualifiedTypeName)
        {
            var typeInClientModel = context.ResolveTypeFromName(qualifiedTypeName);

            if (typeInClientModel == null)
            {
                var typeNamespaceIndex = qualifiedTypeName.LastIndexOf('.');
                if (typeNamespaceIndex > 0)
                {
                    string typeNamespace = qualifiedTypeName.Substring(0, typeNamespaceIndex);
                    typeInClientModel = context.DefaultResolveType(qualifiedTypeName, typeNamespace, typeNamespace);
                }
            }

            return(typeInClientModel);
        }