how to use table tips in Linq to sql

advertisements

how to use table hints in Linq to sql when call submit changes method

dataContext.table2.something = dataContext.table1.something;
dataContext.SubmitChanges();

i want to use it like this sql code:

declare @var int;
begin transaction
select @var = something from table1 with (HoldLock);
update table2 set something = @var;
update table1 set something = @var + 1;
commit transaction;


I've always heard that cant be done. Linq's goal (or at least one of them) is take or mind out of SQL so you dont have to worry with things like this. I suggest that you add your code with the table hint to a SQL procedure and use Linq to call it.