Exemplo n.º 1
0
            public TableToIQueryableConverter()
            {
                // We're now commited to an IQueryable. Verify other constraints.
                Type entityType = typeof(TElement);

                if (!TableClient.ImplementsITableEntity(entityType))
                {
                    throw new InvalidOperationException("IQueryable is only supported on types that implement ITableEntity.");
                }

                TableClient.VerifyDefaultConstructor(entityType);
            }
        public IArgumentBinding <TableEntityContext> TryCreate(ParameterInfo parameter)
        {
            if (parameter.ParameterType.ContainsGenericParameters)
            {
                return(null);
            }

            if (!TableClient.ImplementsITableEntity(parameter.ParameterType))
            {
                return(null);
            }

            TableClient.VerifyDefaultConstructor(parameter.ParameterType);

            return(CreateBinding(parameter.ParameterType));
        }
Exemplo n.º 3
0
        public IArgumentBinding <TableEntityContext> TryCreate(Type parameterType)
        {
            if (parameterType.IsByRef)
            {
                return(null);
            }

            if (parameterType.ContainsGenericParameters)
            {
                return(null);
            }

            TableClient.VerifyDefaultConstructor(parameterType);

            return(CreateBinding(parameterType));
        }
Exemplo n.º 4
0
        public IStorageTableArgumentBinding TryCreate(ParameterInfo parameter)
        {
            if (!parameter.ParameterType.IsGenericType || parameter.ParameterType.GetGenericTypeDefinition() != typeof(IQueryable <>))
            {
                return(null);
            }

            Type entityType = GetQueryableItemType(parameter.ParameterType);

            if (!TableClient.ImplementsITableEntity(entityType))
            {
                throw new InvalidOperationException("IQueryable is only supported on types that implement ITableEntity.");
            }

            TableClient.VerifyDefaultConstructor(entityType);

            return(CreateBinding(entityType));
        }