Beispiel #1
0
        private Type GetSubTypeAsModelType(ParseContext context)
        {
            Type returnType = GetReturnType(context);

            try
            {
                return(Generics.GetParameterType(returnType));
            }
            catch (ArgumentException)
            {
                return(returnType);
            }
        }
Beispiel #2
0
 private Type GetReturnTypeAsCodeType(Type type)
 {
     if (type is Type)
     {
         return((Type)type);
     }
     else
     {
         if (Generics.IsCollectionParameterizedType(type))
         {
             // this case should only happen if the original property was inlined
             return((Type)Generics.GetParameterType(type));
         }
         else
         {
             // this used to throw an exception, but now we can often have no domain types for coded types
             return(typeof(Code));
         }
     }
 }