This project is read-only.

Help with a ranged delete

Jan 27, 2011 at 5:59 PM

Hello,

I'm trying to use the removerange option, and getting an error:

 Here is what i'm doing:

var deleteCP = (from cupr in db.Table<CustomerProducts>() where cupr.CustID == custID  select cupr);

 if  

(deleteCP.Count() > 0)

{ 

 

    db.Table<CustomerProducts>().RemoveRange(deleteCP);

  

  Here I'm getting an invalid operation exception in this piece of code:



 

public void RemoveRange(IEnumerable

<T> range)

{

_raiseCollectionChangedEvents =

false

;

 

try

{

 

 

foreach (var item in

range)

{

Remove(item);

}

}

Jan 28, 2011 at 1:43 AM

Could you please post the entire message and stack trace?  There is not enough information in your message for me to help you out.  The actual line of code that throws exception would be helpful as well.

Thanks.

Sergey