T-SQL u LINQ to SQL

Može li pomoć kako ovaj upit napisati u LINQ to SQL:

DELETE FROM a
WHERE c LIKE ('A')
AND id NOT IN b

http://msdn.microsoft.com/en-us/library/bb386925.aspx

Da preformuliram pitanje, kako napraviti ovakav select (znam kako brisati):

SELECT FROM a
WHERE c LIKE ('A')
AND id NOT IN b

a i b su dva objekta.

http://msdn.microsoft.com/en-us/vcsharp/aa336746
tu bi trebao naći ono što tebi treba, posebno pogledaj select sekciju

Hvala na linku, ali uspio sam rješiti ovako:

from t in a where t.c == "A" && b.Contains(t.id) select t
List<a> aToDelete;

aToDelete = a.Where(t=> t.c == "A" && b.Contains(t.id)).ToList();
//ili

aToDelete = a.Where(t=> SqlMethods.Like(t.c, "%/A/%") && b.Contains(t.id)).ToList(); 
//Ako ti treba %
//ili

aToDelete = a.Where(t=>  t.c.Contains("/A/") && b.Contains(t.id)).ToList(); 
//Linq ekvivalent od %

MyL2S_Context.as.DeleteAllOnSubmit(ToDelete);
MyL2S_Context.SubmitChanges();

Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja