Yes, you can do it that way too. The IsNull() extension method should work however. It works on C#:
EntityCollection<OrderEntity> result = default(EntityCollection<OrderEntity>);
using (DatabaseSpecific.DataAccessAdapter adapter = new DatabaseSpecific.DataAccessAdapter())
{
FactoryClasses.QueryFactory qf = new FactoryClasses.QueryFactory();
var q = qf.Order.Where(OrderFields.ShipCountry.IsNull());
result = (EntityCollection<OrderEntity>)adapter.FetchQuery<OrderEntity>(q);
}
... in VB.Net, it doesn't compile:
Dim result As EntityCollection(Of OrderEntity)
Using adapter As New DatabaseSpecific.DataAccessAdapter
Dim qf As New FactoryClasses.QueryFactory
Dim q = qf.Order.Where(OrderFields.ShipCountry.IsNull())
result = CType(adapter.FetchQuery(q), EntityCollection(Of OrderEntity))
End Using
... as per your compile error. We will look into it.
(Edit)
Indeed it could be due to VB.Net incapacity to differentiate beetween a property and an extension method: http://msdn.microsoft.com/en-us/library/bb384936.aspx
The situation is simpler with properties: if an extension method has the same name as a property of the class it extends, the extension method is not visible and cannot be accessed.
(Edit)
Workaround: call the extension method directly from the class it was created.
Dim q = qf.Order.Where(IsNullPredicateProducers.IsNull(OrderFields.ShipCountry))