示例#1
0
        internal static bool IsValidQueryType(Type paramType, EasyTableContext context)
        {
            if (paramType.IsGenericType &&
                paramType.GetGenericTypeDefinition() == typeof(IMobileServiceTableQuery <>))
            {
                // IMobileServiceTableQuery<JObject> is not supported.
                Type coreType = TypeUtility.GetCoreType(paramType);
                if (coreType != typeof(JObject) &&
                    EasyTableUtility.IsCoreTypeValidItemType(paramType, context))
                {
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
        public Task <IBinding> TryCreateAsync(BindingProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            IBinding result = null;

            // This will be the last IBindingProvider checked in the CompositeBindingProvider,
            // so simply verify the type.
            if (EasyTableUtility.IsCoreTypeValidItemType(context.Parameter.ParameterType, _context))
            {
                result = this;
            }

            return(Task.FromResult <IBinding>(result));
        }
        internal static bool IsMobileServiceTableType(Type paramType, EasyTableContext context)
        {
            if (paramType == typeof(IMobileServiceTable) &&
                !string.IsNullOrEmpty(context.ResolvedTableName))
            {
                return(true);
            }

            if (paramType.IsGenericType &&
                paramType.GetGenericTypeDefinition() == typeof(IMobileServiceTable <>))
            {
                if (EasyTableUtility.IsCoreTypeValidItemType(paramType, context))
                {
                    return(true);
                }
            }

            return(false);
        }
示例#4
0
 internal static bool IsValidEasyTableOutputType(Type paramType, EasyTableContext context)
 {
     // Output bindings also support objects as long as ResolvedTableName is valid
     return(EasyTableUtility.IsValidItemType(paramType, context) ||
            (paramType == typeof(object) && !string.IsNullOrEmpty(context.ResolvedTableName)));
 }