There's a query to search for when an item is contained in a list, but there isn't one for when an item isn't.
This query finds customer objects which don't have ContactNum in the given list cdiffnums. What could I do to return just the customers that dont have a ContactNum in this list?
let q =
query {
for c in dc.Customers do
where (query { for n in cdiffnums do contains c.ContactNum })
select c
}
My F# is rusty, but have you tried:
let q =
query {
for c in dc.Customers do
where (not (query { for n in cdiffnums do contains c.ContactNum }))
select c
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With