views:

346

answers:

1

I'm using Linq to SQL and trying to filter data using DataOptions and AssociateWith. I have a table called Products that has a primary key called Id and a flag called IsDeleted with sql-datatype bit.

When I use the following code I get "Subquery is not supported on 'IsDeleted' of type 'Entities.Product'" exception on AssociateWith method.

var context = new DataContext();
DataLoadOptions options = new DataLoadOptions();
options.AssociateWith<Product>(p => !p.IsDeleted);
context.LoadOptions = options;

Any ideas?

A: 
sirrocco