On Mar 7, 4:56 am, Marc Gravell <marc.grav...@gmail.comwrote:
Just a thought - in this scenario, you aren't really interested in the
fields of the things you are deleting, so I wouldn't bother feftching
them from the database (which will be necessary [or at the least, all
the PKs of such] if you want LINQ to delete them).
If this was me, I'd write a stored procedure that used a few NOT
EXISTS checks, and drag the SP into LINQ (juts to simplify the calling
mechanism).
LINQ is a great tool, but you can mix-and-match generated code and SPs
so that each does things it is good at.
Marc
Hi,
I know ... but in this moment I would like to use only Linq for
this ...
.... later I will probably use a SP.
I came up with:
Dim database As New CodeDataContext
Dim tags = From t In database.Tags _
Where Not (t.FilesTags.Any Or t.ArticlesTags.Any) _
Select t
database.Tags.DeleteAllOnSubmit(tags)
database.SubmitChanges()
It is working. Just one question:
What do you mean with getting only the ID?
How do I do that in my code?
Thanks,
Miguel
P.S: Sorry for my VB.NET code but I am more used to is and it is
faster for me.
When will converters work also with Linq code?