The query:-
select * from Product.Barcodes where Barcode='00A000000O' and
Barcode not in(select Barcode from Sales.SalePointItem)
I have tried the following, but these does not work:-
db.Barcodes.SingleOrDefault(b => b.Barcode.Equals(ItemBarcode) &&
!db.SalePointItems.Select(m=>m.Barcode).Contains(b.Barcode));
db.Barcodes.SingleOrDefault(b => b.Barcode.Equals(ItemBarcode) &&
!db.SalePointItems.Any(m=>m.Barcode.Equals(b.Barcode)));
I get the following exception on running both of above:-
Unable to create a constant value of type 'SalePointItemModel'. Only primitive types ('such as Int32, String, and Guid') are supported in this context.