Hi,
I'm trying to query back to retrieve Deliveries that may match a specified date range. This range may be null/Nothing so I've tried to use the various checks of Is Nothing or .HasValue = False before performing the checks but an exception is always thrown.
Dim lDeliveries = (From delivery As DeliveryEntity In lMeta.Delivery _
Where delivery.Active = True
AndAlso (delivery.DeliveryDate >= mSearchStartDate.Value OrElse mSearchStartDate.HasValue = False) _
Order By delivery.Site.Name, delivery.Site.StreetAddress.City
Select delivery)
It's working if I use the following code but it's not quite as elegant
If (mSearchStartDate.HasValue) Then lUnscheduledDeliveries = lUnscheduledDeliveries.Where(Function(delivery As DeliveryEntity) delivery.DeliveryDate >= mSearchStartDate)
I've donwloaded and am using the latest version of LLBLGen currently available.