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)); }
public IArgumentBinding <TableEntityContext> TryCreate(Type parameterType) { if (parameterType.IsByRef) { return(null); } if (parameterType.ContainsGenericParameters) { return(null); } TableClient.VerifyDefaultConstructor(parameterType); return(CreateBinding(parameterType)); }
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)); }