Forgive me for I am new to nHibernate and have been unable to find answers elsewhere.
Is it possibly at all in nHibernate to duplicate the following SQL so that it is all executed on a single db call:
Code:
DECLARE @ID uniqueidentifier;
DECLARE @ChannelID uniqueidentifier;
DECLARE @Title varchar(MAX);
DECLARE @IsProcessing bit;
SELECT TOP 1
@ID = Id,
@ChannelID = ChannelId,
@Title = Title,
@IsProcessing = IsProcessing
FROM
dbo.UnprocessedItem
WHERE
IsProcessing='False'
UPDATE
dbo.UnProcessedItem
SET
IsProcessing='True'
WHERE
Id = @ID
So that the column IsProcessing is set to true in the db on the UnProcessedItem entity that I retrieve.
Thank you