This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Again! Is it possible to use the remove method in a simpler way, eg... This works... UnitOfWork.Remove(UnitOfWork.Content.Where(c => c.Fk_ContentId == id).First()); But this doesn't seem to work when I want to easily remove multiple records?... UnitOfWork.Remove(UnitOfWork.Content.Where(c => c.Fk_ContentId == id)); Cheers,
|
|
|
UnitOfWork.Remove either operates over a single entity or a query, so we dont take in an enumerable or a queryable as arguments currently. You could do something like this though: UnitOfWork.Content.Where(c => c.Fk_ContentId == id).ToList().ForEach(c => UnitOfWork.Remove(c));
Jeremy |
|
|
Or: UnitOfWork.Remove(new Query( (This is the equivalent of your LINQ expression in LightSpeed 'native' query form, which the Remove method *does* accept.) |
|